<!DOCTYPE html> <html> <head> <title>Simple Function Demo-aimtocode.com</title> <script type="text/javascript"> function firstfunction() { document.write("This is my first function") } </script> </head> <body> <form> <input type="button" value="Click me!" onclick="firstfunction()"> </form> </body> </html>