Answers for "hide a div element but keep in dom"

0

onclick hide div javascript

<script type="text/javascript">
function hide(id) {
	document.getElementById(id).style.display = "none";
}
function show(id) {
	document.getElementById(id).style.display = "";
}
</script>
<div id="div" onclick="hide('div')">
  <p>Click to hide!</p>
</div>
Posted by: Guest on July-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language