问题
I didn’t know about the <button>
tag until today.
回答1:
Basically, <button>
is more flexible as it can contain other tags inside it. Like,
<button type="submit"><strong>Click</strong> me, <em>user!</em></button>
You won't be able to do this with regular <input>
.
回答2:
Check this article
Inputs vs Buttons
Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content. For example, a BUTTON element that contains an image functions like and may resemble an INPUT element whose type is set to “image”, but the BUTTON element type allows content.
回答3:
You can include images in a <button>
tag, but not in an <input>
tag, amoung other differences
回答4:
See: W3C site.
They are very similar but the <button>
tag has a few extras that can be useful on the odd occasion.
来源:https://stackoverflow.com/questions/1398955/whats-the-difference-between-input-type-button-and-button