Currently i have this code
setTimeout(function() { $('#hideMsg').fadeOut('fast'); }, 2000);
is it possible for me to put countdown timer for 2 seconds?
Like
<div id="hideMsg">
The entry you posted not valid.
This Box will Close In 2 Seconds
</div>
“This Box will Close In 2 Seconds” will automatically change to 2sec 1sec
use setInterval instead of setTimeout, then with the combination of clearInterval
html
crazy demo
Making it better.
so that the time will depends on what is inside the
<span>. For example,<span>2</span>is 2 seconds,<span>5</span>is 5 seconds, and<span>60</span>is 1 minute.another crazy demo