I will quote the article The Difference Between Anchors, Inputs and Buttons:
Anchors (the <a>
element) represent hyperlinks, resources a person can navigate to or download in a browser. If you want to allow your user to move to a new page or download a file, then use an anchor.
An input (<input>
) represents a data field: so some user data you mean to send to server. There are several input types related to buttons:
<input type="submit">
<input type="image">
<input type="file">
<input type="reset">
<input type="button">
Each of them has a meaning, for example "file" is used to upload a file, "reset" clears a form, and "submit" sends the data to the server. Check W3 reference on MDN or on W3Schools.
The button (<button>)
element is quite versatile:
- you can nest elements within a button, such as images, paragraphs, or
headers;
- buttons can also contain
::before
and ::after
pseudo-elements;
- buttons support the
disabled
attribute. This makes it easy to turn
them on and off.
Again, check W3 reference for <button>
tag on MDN or on W3Schools.
While <input> elements of type button are still perfectly valid HTML, the newer <button> element is now the favored way to create buttons. Given that a <button>’s label text is inserted between the opening and closing tags, you can include HTML in the label, even images.
– Jakob