1<script type="text/javascript">
2function hide(id) {
3 document.getElementById(id).style.display = "none";
4}
5function show(id) {
6 document.getElementById(id).style.display = "";
7}
8</script>
9<div id="div" onclick="hide('div')">
10 <p>Click to hide!</p>
11</div>
1<style>
2 function hideDiv(){
3 var closedDiv = document.getElementById("closableDiv");
4 closedDiv.style.display = "none";
5 }
6</style>
7<button id="closableDiv" onClick="hideDiv()"> </button>