Results for “option”
Small, practical examples. Search by task or narrow things down below.
Make an unavailable select option unselectable
HTML: A disabled option remains visible but cannot be selected through normal keyboard navigation.
HTML✓ Tested
Offer an optional break inside a long label
HTML: Wbr supplies a potential line-break opportunity without inserting a visible hyphen.
HTML✓ Tested
Parse a short option with getopts
Read a named option and handle invalid flags explicitly.
getopts✓ Tested
Parse a small set of long options
Bash Scripts: Use a loop and case statement to consume a value-bearing long option.
Bash Scripts✓ Tested
Parse a typed command-line option
Python: Use argparse to validate and convert an integer option.
Python✓ Tested
Provide a list of selectable options
HTML: Learn how to provide a list of selectable options in a complete browser example.
HTML✓ Tested
Put an optional service behind a profile
Keep a utility service separate from a normal Compose startup.
Compose✓ Tested
Read a nested optional value
Avoid dereferencing a missing nested object.
optional chaining✓ Tested
Read an optional associative-array entry
Bash Scripts: Use a fallback expansion when a map key may not be present under nounset.
Bash Scripts✓ Tested
Read an optional dictionary key
Python: Use get with a fallback while leaving the dictionary unchanged.
Python✓ Tested
Read an optional JSON property safely
C#: Use TryGetProperty instead of throwing when an optional property is absent.
C#✓ Tested
Read an optional nested value
Read an optional nested value with a standalone Angular component and explicit browser behavior.
Angular✓ Tested