selected
An HTML content command for setting or removing the "selected" attribute on an HTML element.
The value of this command's primary attribute is interpreted as a Boolean value. If the value resolves into true, the "selected" attribute is set. Otherwise the attribute is not set, or removed if the host element currently has it.
This command has a priority of 15.
Examples
The selected
content command is intended to be used in option
elements to dynamically choose which of a select
element's options will be initially selected. Be sure to have only one of the options be selected, unless the select
element in question allows multiple selections.
<select name="favoriteColor"><option dyn-repeat="colorOptions" dyn-repeat-var="color" dyn-content="color.name" dyn-selected="color.isDefault">...</option>