title: how to close this pop up window?
body: <p>how could i close this pop up window?
  in this code i open a popup window that shows some code in another page. i need a BUTTON to close this pop up.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var xmlhttp;
      function showpopup(id) {
          document.getElementById('popup').style.display = 'block';
          if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
              xmlhttp = new XMLHttpRequest();
          }
          else { // code for IE6, IE5
              xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
          }
          xmlhttp.onreadystatechange = function() {
              if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) {
                  document.getElementById('response').innerHTML = xmlhttp.responseText;
              }
          };
          xmlhttp.open('GET', 'more-messages.php?id=' + id, true);
          xmlhttp.send();
      }
  &lt;/script&gt;
  
      &lt;a href='#' onclick=\"showpopup($id)\"&gt;link to ID&lt;/a&gt;
      &lt;div id='popup' style='background-color: #888888; position: absolute; top: 0; left: 0; opacity: 0.4; display: none; width: 100%; height: 100%'&gt;
      &lt;/div&gt;
      &lt;div id='response' style='position: absolute; top: 0; left: 0; width: 40%; margin-top: 14.5%; margin-left: 30%; border: 1px solid balck; background-color: #ffffff; border-radius: 25px;'&gt;
      &lt;/div&gt;  
  </code></pre>