title: How to Make An Element Close After 3 Seconds
body: <p>Hello to anyone viewing this post!</p>
  
  <p>My issue is as described below.</p>
  
  <p>I have a message popup that pops up under what ever php event I'd like to display a message for. The only issue I am having is getting this message popup to close after 3 seconds.</p>
  
  <p>Any help would be great! Thanks in advance!</p>
  
  <p>I have also searched Google and the forums here at StackOverflow and the closest I could come to my issue was here: <a href="https://stackoverflow.com/questions/16127115/closing-popup-window-after-3-seconds">Closing popup window after 3 seconds</a> but even fiddling with this code I was unable to get things working the way I'd like them to.</p>
  
  <p>My Code:</p>
  
  <pre><code>   &lt;script type="text/javascript"&gt;
     // jQuery
     $(document).ready(function() {
       var popup = document.getElementById("msgpop");
       popup.classList.toggle("show");
     });
     &lt;/script&gt;
  </code></pre>
  
  <p>This don't seem to work.</p>
  
  <pre><code>setTimeout(window.close(), function(), 3000);
  </code></pre>