Hone

Lessons · HTML and CSS · cheapest while you are writing it

Cheapest while you are writing it

Most of this is choosing the right element, which costs nothing at the time and a great deal afterwards.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

A <button> instead of a <div> is free. Retrofitting roles, focusability, key handlers and focus management onto a div-based interface can cost more than the interface did.

How to think about it

When somebody calls it a nice-to-have, be specific: name the person it locks out and the fix. 'Our checkout button cannot be reached without a mouse, and it is a one-line change' gets fixed. 'We should be WCAG AA' gets deferred.

Worked example

<button type="submit">Pay</button>
The whole fix, in the case that matters most on the site.

Your turn

Be concrete about the person and the fix, rather than citing

the  number

The trap

'We will do an accessibility pass before launch' almost always means the pass finds architecture, not attributes, and there is no time to change architecture before launch.

Practise cheapest while you are writing it on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.