The following example will display an alert message:
<html> <head> <script language="JavaScript"> function displayAlert() { alert('Message!'); } </script> </head> <body> <input type="button" onclick="displayAlert();" value="Click Me!"/> </body> </html>
_text_