Home  >  Article  >  Web Front-end  >  What does the html button tag mean? Usage details of html button tag

What does the html button tag mean? Usage details of html button tag

寻∝梦
寻∝梦Original
2018-08-20 14:14:536549browse

html What does the button tag mean? Do you know three ways to change the size of html button tags? This article explains what the HTML button tag means, as well as three ways to change the size of the button tag

html button tag definition and usage:

What does the button tag mean: The

Inside the button element, you can place content, such as text or images. This is the difference between this element and buttons created using input elements.

tags is the content of the button, including any acceptable body content, such as text or multimedia content. For example, we can include an image and associated text in a button and use them to create an attractive markup image in the button.

The only prohibited element is the image map, as its mouse and keyboard-sensitive actions interfere with the behavior of the form buttons.

Always specify the type attribute for buttons. The default type in Internet Explorer is "button", while the default in other browsers (including the W3C specification) is "submit".

HTML

The following code marks a button:

<button type="button">Click Me!</button>

html button tag attribute:

What does the html button tag mean? Usage details of html button tag

Comment: Possible values ​​of formenctype attribute:

application/x-www-form-urlencoded

multipart/form-data

text/plain

html Details of using button tags:

I believe that many beginners will inevitably miss some attributes that need to be included behind the tags. The suggestion here is to understand first and then memorize. Don’t memorize word combinations rigidly. Here is a list of things that need to be paid attention to in button labels to enhance your friends’ memory and avoid this problem again. mistake.

Inside the button element, you can place content, such as text or images. This is the difference between this element and buttons created using input elements.

tags is the content of the button, including any acceptable body content, such as text or multimedia content. For example, we can include an image and associated text in a button and use them to create an attractive markup image in the button.

The only prohibited element is the image map, as its mouse and keyboard-sensitive actions interfere with the behavior of the form buttons.

Always specify the type attribute for buttons. There are three types of button type attributes: button (the default value of Internet Explorer for clickable buttons); submit (the button is a submit button (except for Internet Explorer, this value is the default value of other browsers)); reset (the The button is a reset button (clear form data); Internet Explorer's default type is "button", while the default in other browsers (including W3C specifications) is "submit".

But if in an HTML form When using the button element, different browsers will submit different button values. Internet Explorer will submit the text between , while other browsers will submit the content of the value attribute, so be careful to use input Element creates buttons in HTML forms.

Differences between HTML 4.01 and HTML 5

New attributes in HTML 5: autofocus, form, formaction, formenctype, formmethod, formnovalidate and formtarget.

Browser support

All major browsers support the

Important: If in The button element is used in HTML forms, and different browsers will submit different values. Internet Explorer will submit the text between , while other browsers will submit the content of the value attribute. Please Use input elements in HTML forms to create buttons.

Note: If you use button elements in HTML forms, different browsers will submit different button values. Please use input elements to create buttons in HTML forms.

[Related recommendations]

What is the role of the html center tag? Analysis of application examples of the html center tag

html align What does the attribute mean? Introduction to the align attribute setting method in HTML

The above is the detailed content of What does the html button tag mean? Usage details of html button tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn