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 get selected text from a select box using jQuery?
How can I redirect the user from one page to another using jQuery or pure JavaScript?
jQuery Show or Hide text on button click
Edit the text of label on click using jQuery
jQuery example of scroll to top
How to the length of the longest word in the provided sentence?