<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