Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

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>
 
PREVIOUS NEXT
Tagged: #html #button #hide #show
ADD COMMENT
Topic
Name
5+1 =