title: how to show a div only for 3 seconds and disappear again using jquery?
body: <p>i have my html like this</p>
  
  <pre><code>&lt;p id="msgfail"  hidden="hidden" &gt;Theres an error processing ur request&lt;/p&gt;
  &lt;p id="sucessmsg"  hidden="hidden"&gt;Success fully update database&lt;/p&gt;
  </code></pre>
  
  <p>when i click a button it triggers attempt to enter data to mysql database. and the corresponding p item is made visible. now my question is how do i make it dissapear again after a timeout ?</p>
  
  <p>i tried it this way</p>
  
  <pre><code>if ($("#msgfail").is(":visible")) {
    setTimeout(function() {$("#msgfail").hide();}, 3000);
  }
  </code></pre>