It may seem cliché, but I did not find and could not adapt any code here from the site to my needs. I apologize if it is content redundancy, but in the future it may help other people.
How can I be adding a FadeIn and FadeOut effect when opening and closing the element, based on the following javascript script:
The following is working, but not just the effect of opening.
NOTE: I would also like to know if it is possible to click the same button to close the DIV with a FadeOut.
HTML :
<button type="button onclick="Mudarestado('formulario')">Abrir div</button>
Javascript:
function Mudarestado(el) {
var display = document.getElementById(el).style.display;
if(display == "none")
document.getElementById(el).style.display = 'block';
else
document.getElementById(el).style.display = 'none';
}