<html> <head> <script type="text/javascript"> function mymessage() { alert("This message was triggered from the onload event"); } </script> </head> <body onload="mymessage()"> </body> </html>
Your Result:
Edit the code above and click to see the result.
W3Schools.com
- Try it yourself