Answers for "hide one div and show another javascript"

1

onclick show div and hide other div

<div id="1">A DIV element...</div>
<div id="2">Another DIV element</div>
<div id="3">The third DIV element</div>
<div id="4" onclick="hide()">Click me to hide the other DIVs</div>
<script type="text/javascript">
function hide() {
	document.getElementById("1").hidden = true;
	document.getElementById("2").hidden = true;
	document.getElementById("3").hidden = true;
	document.getElementById("4").hidden = false;
}
</script>
Posted by: Guest on September-01-2021
-1

hide and show div using javascript with example

hide and show divs using javascript
Posted by: Guest on July-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language