<select class="language-selector"…>
👎 <option value="/" selected='true'> English </option> 👈 Change from this
👍 <option value="/" selected> English </option> 👈 to this
According HTML5 spec on boolean attributes
If the attribute is present, its value must either be the empty string or a value that is a case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.
Describe your changes
The code create a single selected attribute instead of a selected='true' as required by the html5 spec.
An empty attribute object is first created.
It is populated with the selected attribute if needed, using js spread syntax.
Finally the attribute object is injected in the option tag.
According HTML5 spec on boolean attributes
If the attribute is present, its value must either be the empty string or a value that is a case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.
Describe your changes
The code create a single selected attribute instead of a selected='true' as required by the html5 spec.
An empty attribute object is first created.
It is populated with the selected attribute if needed, using js spread syntax.
Finally the attribute object is injected in the option tag.
Fixes
Warnings with html syntax checkers.
Checklist