Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the main differences (pros v. cons) of designing a simple linked button by <a> tag instead of <button> tag?

I see in many cases <a> tag is used instead of <button> tag to design a button where it is a simple link button (for example not a submit button of a form). What are the main differences (pros v. cons) of designing a simple linked button by <a> tag instead of <button> tag?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

A link is an HTML feature for linking to another page. It is announced as a link by screen readers. Search engines are really good are finding where it links to. It has default styling that visually indicates to the user that it is a link. It works without needing JS.

A (non-submit) button is a feature for hanging JavaScript from. Screen readers don’t tell the user it is a link. Search engines are less good at discovering where it links to. It doesn’t look like a link. It fails if JS fails for any reason.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading