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.





Category:
Web Tutorial
Sub Category:
HTML Form Elements
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference