Prev Demo
Alerting The User With The Named Function
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <ha>Alerting the user with the named function.</h1> <p>Alert the user with named function after 2 seconds with an alert "WARNING!"</p> <input type="button" value="Alert" onclick="myName()"/> <script> function myName() { a = setTimeout(myAlert, 2000); } function myAlert(){ alert("WARNING!"); } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output