This article mainly introduces the type of HTML button tags, as well as the role and use of HTML button tags, and finally the use of examples, now let's look at this article together
First look at the HTML button label how much do we know?
There are three types of HTML button tags:
Type= "Submit": the Submit button (except Internet Explorer, which is the default value for other browsers).
Type= "button": Clickable button (the default value for Internet Explorer).
Type= "reset": Reset button (clears form data).
PS: When the button tag is included in the form tag, for example:
<form action= "www.php.cn" > <button> click </button></form>
Now talk about the role of the HTML button tag:
Because button is submit by default in most browsers, if the Action property of the form tag has a value, clicking the button will jump to the link "www.php.cn" It is set to, otherwise clicking on button will refresh the current page.
The,<button> tag in HTML is used to define a button that can be placed in a <button> tag (text, image, etc.). The <input> tag is also defined as a button, and the difference between it and the <button> tag is that the <input> tag is a single label, no element content,<button> tag is a double label, can have element content, so < Button> tags have more powerful features and richer content.
Note: Creating a button in an HTML form generally uses the <input> tag, because if you use the <button> tag in the form, different browsers will submit different values.
The <button> tag is best set with the Type property, because the browser may have different default values for the Type property of the <button> tag.
Now, the use of the HTML button tag:
button more functions inside the button element, you can place content, such as text or images.
<button> controls provide more powerful functionality and richer content than <input type= "button" >. However, the type attribute should be specified at all times in use;
In the form form, the default type of Internet Explorer is "button", while the default value in other browsers, including the Web specification, is "submit".
The use of course is to see the example:
<! DOCTYPE html>