We want a way for someone to choose an item from a list of options, but it’s more complicated than just that. We want autocomplete options. We want to put images in there, not just text. The
optgroupelement is ugly, hard to style, and not announced by screen readers. I had high hopes for the
datalistelement, but it’s no good for people with low vision who zoom or use high contrast themes.
selectinputs are limited in a lot of ways. Let’s work out how to make our own while keeping all the accessibility features of the original.
For many years I’ve placed script elements just before the closing
body tag rather than in the
<head>. Since a standard
<script> element is render-blocking, the theory is that by putting it at the end of the document – after the main content of the page has loaded – it’s no longer blocking anything, and there’s no need to wrap it in a
DOMContentLoaded event listener.
It turns out that my time-honoured default is OK, but there is a better approach.
Create and share beautiful images of your source code. Start typing or drop a file into the text area to get started.
My notes and reminders for handling promises with
await In Real Life.
My first Christmas working at FreeAgent. Strong Christmas Jumper game!
Just because Stimulus.js is designed to work primarily with existing HTML doesn’t mean it can’t use JSON APIs when the need arises.
A disclosure component is the formal name for the pattern where you click a button to reveal or hide content. This includes things like a “show more/show less” interaction for some descriptive text below a YouTube video, or a hamburger menu that reveals and hides when you click it.
Is online advertising working? We simply don’t know