Simple button example

This page contains a simple button that calls the built-in alert function when clicked. Click on the button to see it in action.

 


 

The HTML code for the button above is:

<input type='button' value='Click here!' onClick='alert("You clicked the button!")'>

 


 

View the source for this page to see the function and button definitions in their full context. Depending on your browser and operating system, you may be able to view the page source from a menu option or by right-clicking or control-clicking on the page.