Categorize long lists

optgroup

The optgroup element provides a way to break a long list of options into smaller distinguishable sub-lists.

Properties

label
Put the descriptive label to display to the user in a "label" attribute.

Example

form {
select *country= {
optgroup *label='North America' {
option *value='ca' Canada
option *value='us' United States of America
option *value='mx' Mexico
}
optgroup *label='South America' {
option *value='br' Brazil
option *value='pe' Peru
option *value='ar' Argentina
option *value='cl' Chile
}
}
}
The optgroup element
0

semantax > input-output > optgroupCategorize long lists

🔗 🔎