The <button> Tag is a clickable button at intervals hypertext markup language form on your webpage. you’ll be able to place content like text or image at intervals the <button>……<button> Tag.
You should continuously specify the kind attribute for a tag. totally {different completely different} browsers use different default sort for the button part.
HTML <Button> Tag will be used within and outdoors the form.
The button Tag will act as a submit button if you use it inside the form and you can also use the reset button inside the form.
If you use the Button outside of the form, you can click on it using the JavaScript Function.
Table of Contents
Normal Button Tag
Example:-
<button name="button" type="butto<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Button tag </title>
</head>
<body>
<h1>The HTML Button Tag</h1>
<button name="button" type="button">Click Here</button>
</body>
</html>
Output:-
Button Tag With JavaScript Function
Example:-
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Button tag </title>
</head>
<body>
<h1>The HTML Button Tag</h1>
<button name="button" type="button">Normal Button</button>
<button name="button" value="OK" type="button" onclick="hello()">Javascript Button</button>
<script>
function hello(){
alert("hello Well-Come Myprograming");
}
</script>
</body>
</html>
Output:-
The HTML Button Tag
Button Tag With Submit Form
Example:-
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Button tag </title>
</head>
<body>
<h1>The HTML Button Tag</h1>
<form>
<input type="text" name="text" placeholder="Enter Name"> <br> <br>
<button>SUBMIT</button>
</form>
</body>
</html>
Output:-
Button Tag With Reset Form
Example:-
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML Button tag </title>
</head>
<body>
<h1>The HTML Button Tag</h1>
<form>
<input type="text" name="text" placeholder="Enter Name"> <br> <br>
<button type="reset">RESET</button>
</form>
</body>
</html>
Output:-
Attributes of HTML Button Tag
- autofocus
- disabled
- form
- formaction
- formmethod
- formenctype
- formnovalidate
- formtarget
- name
- type
- value
Related Pages
Create a Website link Button Attribute
One thought on “HTML Button Tag”