title: Click outside div to hide div in pure JavaScript
body: <p>I want to make a popup that should appear once a button is clicked and disappear once the user clicks outside of the box.</p>
  
  <p>I'm not sure how to make the div disappear when I click outside of it. </p>
  
  <pre><code>var popbox = document.getElementById("popbox");
  
  document.getElementById("linkbox").onclick = function () {
      popbox.style.display = "block";
  };
  
  ???.onclick = function () {
      popbox.style.display = "none";
  };
  </code></pre>