The difference between BUTTON tag and INPUT tag
Jun 27, 2017 am 11:33 AMSummary of the theme in one sentence: <button> has the same effect as <input type="button" ... > but is more powerful in terms of controllability.
The Forms part of the HTML 4.01 specification has the following control types: buttons, checkboxes, radio buttons,
menus, text input, file select, hidden controls, object controls.
Except for buttons/menus/object controls, all are completed by <input>.
What I’m talking about here is <button> and <input>.
<button> and <input>
As specified in the specification: <button> and <input> can be used to make form buttons. Please refer to the detailed definitions of these elements for different button types. It should be noted that <button> supports richer presentation functions than <input>.
Some differences
Everyone knows that <input> can be used like this (in fact, it must be used like this): <input type="submit" value="OK"
/>, must be closed like this. Instead of: <input type="submit" value="OK"
></input>. Because the opening tag is required, but the closing tag is prohibited.
<button> is more powerful than <input> in that it can contain content. Its value is not written in the value attribute, but is included in the tag.
For example: <button>OK</button>. The opening tag and closing tag of <button> are required. This way you will get something like
formalized dominance.
You can write like this:<button><strong>OK</strong>, I
do.</button>, or even insert image:<button><img src="button.gif" alt=""
/>, it's great.</button>. Somewhat similar to <input
type="image">, but it is obviously much more powerful.
The last thing to note is that images included in <button> cannot use hotspotsmap, that is, they cannot<img src="foo.gif"
usemap="..." />, this is illegal. Of course, it can no longer contain items such as input, select, textarea, label,
button, form, fieldset, iframe, and isindex (deprecated) elements.
Not original, sourced from the Internet.
Summary of the theme in one sentence: <button> has the same effect as <input type="button" ... > but is more powerful in terms of controllability.
The Forms part of the HTML 4.01 specification has the following control types: buttons, checkboxes, radio buttons,
menus, text input, file select, hidden controls, object controls.
Except for buttons/menus/object controls, all are completed by <input>.
What I’m talking about here is <button> and <input>.
<button> and <input>
As specified in the specification: <button> and <input> can be used to make form buttons. Please refer to the detailed definitions of these elements for different button types. It should be noted that <button> supports richer presentation functions than <input>.
Some differences
Everyone knows that <input> can be used like this (in fact, it must be used like this): <input type="submit" value="OK"
/>, must be closed like this. Instead of: <input type="submit" value="OK"
></input>. Because the opening tag is required, but the closing tag is prohibited.
<button> is more powerful than <input> in that it can contain content. Its value is not written in the value attribute, but included in the tag.
For example: <button>OK</button>. The opening tag and closing tag of <button> are required. This way you will get something like
formalized dominance.
You can write like this:<button><strong>OK</strong>, I
do.</button>, or even insert an image: <button><img src="button.gif" alt=""
/>, it's great.</button>. Somewhat similar to <input
type="image">, but it is obviously much more powerful.
The last thing to note is that images included by <button> cannot use hotspot maps, that is, they cannot use <img src="foo.gif"
usemap="..." />, this is illegal. Of course, it can no longer contain items such as input, select, textarea, label,
button, form, fieldset, iframe, and isindex (deprecated) elements.
Not original, sourced from the Internet.
The above is the detailed content of The difference between BUTTON tag and INPUT tag. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

deepseek What is the difference between r1 and v3 version

Does Bitcoin have stocks? Does Bitcoin have equity?

What is the difference between pre-market and after-market trading? Detailed explanation of the differences between pre-market and after-market trading

Why is Bittensor said to be the 'bitcoin' in the AI track?

Is there any difference between South Korean Bitcoin and domestic Bitcoin?

Pepe bought and sold out in a big way, is MUTM a smarter investment in 2025?

Vertical proxy: Application scenarios and interpretation of disruptive potential of encryption native proxy
