Mostrar-ocultar elemento / Show-hide element


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function mostrarOcultar(nombre) {
  2. elemento = document.getElementById(nombre);
  3. elemento.style.display = elemento.style.display == "block" ? "none" : "block";
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.