Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is mostly true, but it's usually better/easier to use the semantic element for any particular use case. In this case, for example, to correctly mimic how the <a> tag works, you'll need to handle both click events and keyboard events (e.g. space for clicking), and even then you'll struggle to handle right-clicks, ctrl-clicks or middle clicks in a way that is truly cross-platform.

The <a> tag, on the other hand, just does all that for you.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: