2

How can we set in javascript or jquery for example:

time = 0; //0 second
// and time will start by 1 second to infinite second
if(time <= 10) {  // 10 is 10 second here
    alert("abc");
} else {
    alert("xyz");
}

Suppose web page is loaded and time should increment by 1 second and when it has been 10 second it should alert abc and when more than 10 second it should alert xyz

The whole process should run automatically when page is loaded not by clicking on start and end button

Please help me to find it? Thanks in advance.

Jasbir
  • 374
  • 5
  • 15
  • when will you check for the time and when do you start to count the time? – Danial_Abzadough Feb 23 '21 at 12:52
  • @Danial_Abzadough Suppose web page is loaded and time should increment by 1 second and when it has been 10 second it should alert abc and when more than 10 second it should alert xyz – Jasbir Feb 23 '21 at 12:55

0 Answers0