& Lt; input type = "button" & gt; and & lt; button & gt;, inputbutton

Source: Internet
Author: User

<Input type = "button"> and <button>, inputbutton
Differences between <input type = "button"> and <button>:
The two tags in the title have almost no difference in appearance and usage. The following describes the differences between the two buttons.
Difference 1:
Compared with <input type = "button">, <button> has more tag formats. In addition to text, <button> and <tton> can also be images or multimedia content, however, it cannot be an image ing because its mouse-and keyboard-sensitive actions interfere with form buttons.
Difference 2:
The type attribute of <button> must be specified. Otherwise, some problems may occur. In IE, if type is not added, it will be treated as a button, however, Google, Firefox, and other standard browsers are processed as the "submit" button.
Difference 3:
For how to obtain the value attribute value, see the code:

<Button value = "ant tribe 1"> ant tribe </button> <input type = "button" value = "ant tribe 2"> ant tribe </button>
If you want to obtain the value attribute value, the values are different. In IE7 and IE87 browsers, the value obtained from <button> is the content between <button> and <tton>, in other standard browsers, the value is the value of the obtained value attribute. <Input type = "button"> is to obtain the value of its value attribute value.
The code example is as follows:
<! DOCTYPE html> 

The above code can be used to test the part of the obtained value in different browsers.

Original address: http://www.51texiao.cn/HTML5jiaocheng/2015/0521/2132.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.