Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7956513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:00:51+00:00 2026-06-04T04:00:51+00:00

I have a jquery timer on my page that counts down from 10 to

  • 0

I have a jquery timer on my page that counts down from 10 to 0. At 5 seconds I want to show a warning message then at 0 seconds I want to show another message.

I have used the code below which will do the count down in the form field as well as give the alerts, however the countdown stops when the alerts show:

$(function(){
    var count = 10;
    countdown = setInterval(function(){
        $("#Exam_Timer").val(count + " seconds remaining!");
        if (count == 5) {
            alert('Only 5 Seconds Left');
        }   
        if (count == 0) {
            alert('Times Up')
        }
    count--;
    }, 1000);
});

Can someone let me know how I would restructure this so that the alerts do no stop the countdown?

I tried putting the alert into a separate function but that did not help. I have created a Fiddle:

http://jsfiddle.net/CQu7T/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:00:52+00:00Added an answer on June 4, 2026 at 4:00 am

    You cant do this with alert as it stop scripts execution. However you can achieve this with jQuery UI dialogs. Check the following demo

    Working Demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have jquery with class= modal i want to call that class when page
I have multiple ajax forms on page that cointain same elemets, I have jquery
I need some help with my jQuery script. I have a page that refreshes
I have the following jQuery function that I'm using to display a timer on
On my site I have a jquery function which retrieves data from another (secured)
I have a timer every 20 seconds using setInterval, it uses jQuery's ajax function
I have a peice of code that counts from 0 to a specified number
I have a jquery plugin that autofreshes the page every 5 mins. (function($) {
I have a jQuery UI progressbar that acts as a timer. However when I
I have a page that includes various blocks of information retrieved from db. Those

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.