<html> <head> <title>A Simple Page</title> <script language="JavaScript"> function yourMessage() { alert("You clicked on a link!"); } </script> </head> <body> <a href="http://www.java2java.com" onClick="yourMessage()">My Website!</a> </body> </html>