summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/rendering/widgets/the-select-element/option-rm-label.html
blob: a5272cf6f1f26d0a305d6cffd8844092869ac398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!DOCTYPE html>
<meta charset="utf-8">
<title>OPTION's label attribute in SELECT -- Removing the 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="Bad Label Text">Label Text</option>
</select>
<br/>
<select size="4">
  <option label="Bad Label Text">Label Text</option>
</select>
<script>
let options = document.querySelectorAll("option");
options[0].getBoundingClientRect(); // force layout.
for (let option of options) {
  option.removeAttribute("label");
}
</script>