Use semantic button tags instead of divs for interactivity
Many times, when we have some requirement where we need to show beautiful buttons, we end up using div tags instead of button. And this could lead to highly inaccessible code if we do not think about assistive tech users.
HTML 5 has a semantic element called button
which should be used for any click through action.
Alternatively, if we really need to use any non-semantic tag instead of button
tag, we need to provide extra attributes and event handlers to make to accesible to assistive tech users.
Jump to code tips to make accessible buttons