<html> <head> <script language="JavaScript"> <!-- function myFunction() { alert("Hello World!"); } //--> </script> </head> <body> <a href="javascript:myFunction()">Click me</a> </body> </html>