javascript - How to open a modal pop up after timer runs out? -


i beginner in javascript , writing js code web application stuck @ 1 point.

i have web page timer 5 seconds , after timer runs out expect modal popup.

i have written code here:

var count=-1; // -1 having delay of 1000ms  var counter=setinterval(timer, 1000); //1000  run every 1 second  function timer() {     count=count+1;     if (count >=6) //+1 req time have delay of 1000ms     {         clearinterval(counter);         /////////////what code should go here modal pop up??///////////////////////         return;     }     document.getelementbyid("timer").innerhtml=count + " secs"; // watch spelling } 

i want know code enable pop after timer runs out.

all need select modal (with jquery) , call modal() method:

$("#mymodal").modal(); 

that invoke modal. i've modified fiddle give example here: jsfiddle example.


Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -