Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<meta charset="utf-8">
<title>OPTION's label attribute in SELECT -- Adding a label (quirks)</title>
<link rel="match" href="option-label-ref.html">
<meta name="assert" content="An option element is expected to be rendered by displaying the element's label.">
<select>
<option>Element Text</option>
</select>
<br/>
<select size="4">
<option>Element Text</option>
</select>
<script>
let options = document.querySelectorAll("option");
options[0].getBoundingClientRect(); // force layout.
for (let option of options) {
option.setAttribute("label", "Label Text");
}
</script>