Signs it is time to revisit semantic HTML
The advice here is unglamorous, which is probably why it gets skipped. A few signals that semantic HTML is due some attention.
The question is rarely whether something can be built, but what it costs to keep running afterwards. Budget a little time for it every quarter and it never becomes a project of its own.
The signals
- Nobody can say when it was last reviewed
- The answer depends on who you ask
- The right element gives you behaviour and accessibility for free
- A div with a click handler is not a button
How to approach it
Semantic markup is the cheapest accessibility work available. That sounds obvious written down. It is still the thing most often skipped. Write the reasoning down alongside the decision, because the reasoning is what changes first.
In practice
Most development decisions are really maintenance decisions wearing a different hat. Three things worth confirming about semantic HTML before you move on:
- Someone can say what the current setup is without going to look
- A div with a click handler is not a button — and you know whether that is true here
- There is a way to tell whether the last change to this helped
If any of that sounds like a description of your current setup, it is fixable.