Good, I have a problem and it only works for me the first time I give it, that is, the first
if
(what I hide it), but when I give it back it does not show it and it stays hidden the elements
function funcion_ocultar_mostrar () {
var visible = true;
//ocultar
if(visible === true){
textarea.style.display = 'none';
btn_enviar.style.display = 'none';
btn_ocultar.innerHTML= 'Mostrar';
console.log('ocultar');
}
//mostrar
else if(visible === false){
//textarea.style.display = 'none';
textarea.style.display = 'block';
btn_enviar.style.display = 'block';
btn_ocultar.innerHTML= 'Ocultar';
console.log('mostrar');
}
visible = !visible;
}
may also be that it is not doing well at the time of showing it again. I do not know, I'm not sure.