Button Click Call Alert

[Total: 0    Average: 0/5]

This file shows a very simple example of how to create a button that does something JavaScript-like in nature when it is clicked. The alert() function is predefined: we could have made our own function and then called it upon the onClick event.

Body Code:

<form><input type="button" value="click me" onClick="alert('You clicked me!')"></form>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *