mirror of
https://github.com/servo/servo
synced 2026-05-12 01:46:28 +02:00
22 lines
713 B
HTML
22 lines
713 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>OPTION's label attribute in SELECT -- Adding a label</title>
|
|
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-select-element-2">
|
|
<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 label="Element Text">Label Text</option>
|
|
</select>
|
|
<br/>
|
|
<select size="4">
|
|
<option label="Element Text">Label Text</option>
|
|
</select>
|
|
<script>
|
|
let options = document.querySelectorAll("option");
|
|
options[0].getBoundingClientRect(); // force layout.
|
|
for (let option of options) {
|
|
option.setAttribute("label", "");
|
|
}
|
|
</script>
|