HTML Concepts: Commands and Facets
Published on March 29, 2022 (↻ August 17, 2024), filed under Development (RSS feed for all categories).
In the HTML concepts series I’m presenting lesser known ideas from the huge HTML specification. In this episode, let’s have a quick look at commands and facets.
Commands
Commands should be what you think they are. A command is defined as “the abstraction behind menu items, buttons, and links.” It’s what you issue when you interact with them, that is, click or press on either.
Accordingly,
- an
a
element with anhref
attribute defines a command; as does - a
button
element (“always”); - an
input
element whosetype
attribute is in a “Submit Button, Reset Button, Image Button, Button, Radio Button, or Checkbox” state; - an
option
element with an ancestorselect
element and either novalue
attribute, or one that is not the empty string; - a
legend
element that has an assigned access key, is a child of afieldset
element, and whose parent has a descendant that defines a command that is neither alabel
nor alegend
element; and - any element that has an assigned access key.
Facets
Facets are rarely mentioned anywhere; they are something a command has. There are the following facets:
- Label: the name of the command.
- Action: the effect of the command when triggered, like a URL to navigate to, a form submission, or an event handler.
- Access key (optional): a key combination selected by the user agent which triggers the command.
- Hidden state (optional): information on whether the respective command is hidden.
- Disabled state (optional): information on whether the respective command is relevant and can be triggered.
❧ Commands are easy to work with, as they represent something actionable. Facets may be what you can now recall as something that specifies and gives information about a command. Review other concepts, and see you in a follow-up post of this series.
About Me
I’m Jens (long: Jens Oliver Meiert), and I’m a frontend engineering leader and tech author/publisher. I’ve worked as a technical lead for companies like Google and as an engineering manager for companies like Miro, I’m a contributor to several web standards, and I write and review books for O’Reilly and Frontend Dogma.
I love trying things, not only in web development (and engineering management), but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (Please be critical, interpret charitably, and give feedback.)
Read More
Maybe of interest to you, too:
- Next: 4 Books to Become More Efficient and Effective
- Previous: What Makes You a Professional Web Developer
- More under Development
- More from 2022
- Most popular posts
Looking for a way to comment? Comments have been disabled, unfortunately.
Get a good look at web development? Try WebGlossary.info—and The Web Development Glossary 3K. With explanations and definitions for thousands of terms of web development, web design, and related fields, building on Wikipedia as well as MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.