HTML Concepts: Commands and Facets
Post from March 29, 2022, filed under Web Development.
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.
aelement with an
hrefattribute defines a command; as does
typeattribute is in a “Submit Button, Reset Button, Image Button, Button, Radio Button, or Checkbox” state;
optionelement with an ancestor
selectelement and either no
valueattribute, or one that is not the empty string;
legendelement that has an assigned access key, is a child of a
fieldsetelement, and whose parent has a descendant that defines a command that is neither a
- any element that has an assigned access key.
Facets are rarely mentioned anywhere; they are something a command has. There are the following facets:
- Label: the name of the command.
- 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.
- Action: the effect of the command when triggered, like a URL to navigate to, a form submission, or an event handler.
❧ 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.
I’m Jens, and I’m an engineering lead—currently manager for Developer Experience at LivePerson—and author. I’ve worked as a technical lead for Google, I’m close to W3C and WHATWG, and I write and review books for O’Reilly. I love trying things, sometimes including philosophy, art, and adventure. Here on meiert.com I share some of my views and experiences.
If you have a question or suggestion about what I write, please leave a comment (if available) or a message. Thank you!
Maybe this is interesting to you, too:
- Next: 4 Books to Become More Efficient and Effective
- Previous: What Makes You a Professional Web Developer
- More under Web Development, or from 2022
- Most popular posts
Looking for a way to comment? Comments have been disabled, unfortunately.
Get a good look at web development? Try The Web Development Glossary (2020). With explanations and definitions for literally thousands of terms from Web Development and related fields, building on Wikipedia as well as the MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.