Calling a Function from an Event Handler
<html> <head> <script type="text/javascript"> function showMsg(msg) { document.write("The button sent: " + msg); } </script> </head> <body> <form> <input type="button" value="Click Me" onclick="showMsg('The button has been clicked!')"> </form> </body> </html>