I want to display the alert box but for a certain interval. Is it possible in JavaScript?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want an alert to appear after a certain about time, you can use this code:
If you want an alert to appear and disappear after a specified interval has passed, then you’re out of luck. When an
alerthas fired, the browser stops processing the javascript code until the user clicks “ok”. This happens again when aconfirmorpromptis shown.If you want the appear/disappear behavior, then I would recommend using something like jQueryUI’s dialog widget. Here’s a quick example on how you might use it to achieve that behavior.