how to make javascript make things disappear

Solutions on MaxInterview for how to make javascript make things disappear by the best coders in the world

showing results for - "how to make javascript make things disappear"
Juliana
17 Mar 2020
1<html>
2<script type="text/javascript">
3<!--
4    function toggle_visibility(id) {
5       var e = document.getElementById(id);
6       if(e.style.display == 'block')
7          e.style.display = 'none';
8       else
9          e.style.display = 'block';
10    }
11//-->
12</script>
13<body>
14<a href="#" onclick="toggle_visibility('foo');">Click here</a>
15<div id="foo">This is foo</div>
16</body>
17</html>
18