<html> <head> <script type="text/javascript"> function disp_alert() { alert("I am an alert box!!"); } </script> </head> <body> <input type="button" onclick="disp_alert()" value="Display alert box" /> </body> </html>
Your Result:
Edit the code above and click to see the result.
W3Schools.com
- Try it yourself