Here's a regular alert button:
When you click the "SET TIMER for Alert" button, an alert will pop up after the number of seconds you chose.
If you want to STOP the timed alert from showing up, click "STOP Alert" button!
Here is a TIMED alert:
And here is a way to intercept it:
* Create a new XHTML file.
* Prompt the user for a time between 1-9 seconds.
* Tell the user (on the page) that when they click the button on the page an alert will pop up
after the number of seconds they entered has passed.
* After the number of seconds they entered has passed, pop up an alert that
tells the user that X seconds has passed.
* HINT: remember, setTimeout uses milliseconds—you'll have to convert the user entry.
HEAD:
function alertDisplay() {
alert(seconds + " seconds have passed since you pressed the button."); }
BODY:
Button 1: <input type="button" onclick="alert('You Clicked Me!!')" value="Click for Alert" />
Button 2: <input type="button" onclick = "warning = setTimeout( ' alertDisplay() ' ,
seconds * 1000);" value="SET TIMER for Alert" />
Button 3: <input type="button" onclick="clearTimeout(warning)" value="STOP Alert!" />