title: Hide 'div' tag in JavaScript
body: <p>I have JavaScript code that hides a tag when it is clicked:</p>
  
  <pre><code>document.getElementById("div").style.visibility="hidden";
  </code></pre>
  
  <p>Although when I do this, even though the div tag is hidden, there is still a space where the div tag is located. how do I collapse the whole div tag using JavaScript?</p>