Menu

Chris’ Corner: HTML – CodePen
📰

Chris’ Corner: HTML – CodePen

#codepen#html#input#something#javascript
Reading 0:00
15s threshold

I’m with Den Odell here in HTML’s Best Kept Secret: The <output> Tag . I have a real affinity for that tag, perhaps because of it’s lovely balance pairing with <input> . If you’ve got any sort of value you’re displaying that is derived from inputs, it’s the perfect tag. Not just semantically, but accessibly too.

Most have never touched it. Some don’t even know it exists.

That’s a shame, because it solves something we’ve been cobbling together with <div> s and ARIA for years: dynamic results that are announced to screen readers by default.

So imagine like two numbers inputs where you add the numbers together and show the result. Just an example meant to get you thinking about any sort of input/output scenario:

If you are working with specifically with <input type="number"> , Ollie Williams has some nicely-explained and practical information in A complete guide to the HTML number input .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.