Horje
How to create HTML <button> Element

The <button> element defines a clickable button:


Simple Example of HTML Button

 <button type="button" onclick="alert('Hello World!')">Click Me!</button> 

Full Example of HTML Button

The button Element
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>The button Element</h2>

<button type="button" onclick="alert('Hello World!')">Click Me!</button>

</body>
</html>

Output should be:

Full Example of HTML Button

Note: Always specify the type attribute for the button element. Different browsers may use different default types for the button element.





Related Articles
What is HTML Form Elements HTML Form Elements
How to create HTML <input> Element HTML Form Elements
How to create The <label> Element HTML Form Elements
How to create HTML <select> Element HTML Form Elements
How to create HTML <option> element HTML Form Elements
How to Visible HTML Select Option Values HTML Form Elements
How to Allow Multiple Selection in HTML Option Value HTML Form Elements
How to create HTML <textarea> Element HTML Form Elements
How to create HTML <button> Element HTML Form Elements
How to create HTML <fieldset> and <legend> Elements HTML Form Elements
How to create HTML <datalist> Element HTML Form Elements
How to create HTML <output> Element HTML Form Elements

Single Articles
Simple Example of HTML ButtonHTML Form Elements
Full Example of HTML ButtonHTML Form Elements

Read Full:
HTML Form Elements
Category:
Web Tutorial
Sub Category:
HTML Form Elements
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
59


Reffered: https://www.w3schools.com/html/html_form_elements.asp

Share on: