<html> <head> <title>An onclick script</title> <script type="text/javascript"> function alertUser() { document.write("Hi!"); } </script> </head> <body> Here is some body text. <form> <input type="text" name="entry"> <input type="button" name="oneButton" value="Press Me!" onclick="alertUser()"> </form> </body> </html>