When the user clicks on the button, the onclick event has been fired and the JavaScript message listed in the value of the attribute are executed.
Example
<!DOCTYPE html>
<html>
<head>
<title>onClick Demo</title>
</head>
<body>
<input type="button" onclick="alert('You clicked the button!')" value="Click Me" />
</body>
</html>
Most Helpful This Week
How to scroll page to particular Div on click using jQuery?
How to define Global Variable in JavaScript?
Edit the text of label on click using jQuery
How to join string with number in JavaScript?
jQuery simple form with name and email validations
jQuery show input text inside div after on click event