The HTML <input type = “button”> is used to define a clickable Button in a Document. It is mostly used with the Javascript to activate the script.
Syntax:
<input type="button">
Example:
html
< html >
< head >
< title >
HTML input type="button"
</ title >
</ head >
< body style="text-align:center;">
< h1 >GeeksForGeeks</ h1 >
< h2 >HTML <input type = "button"></ h2 >
< input type="button"
onclick="send()"
value="submit">
< script >
function send() {
alert("Hello World");
}
</ script >
</ body >
</ html >
|
Output:
Supported Browsers:
- Google Chrome 1.0 and above
- Firefox 1.0 and above
- Edge 12 and above
- Opera
- Apple Safari 1.0 and above
- Internet Explorer