Answers for "how to hide and show class in javascript"

1

how to hide javascript element by class

document.getElementsByClassName('className')[0].style.visibility='hidden';
Posted by: Guest on June-15-2020
1

html button that hide and show

<button onclick="toggleText()">button</button>
<p id="Myid">Text</p>
<script>
function toggleText(){
  var x = document.getElementById("Myid");
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }
}
</script>
Posted by: Guest on October-17-2020

Code answers related to "how to hide and show class in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language