<!DOCTYPE html>
<html lang="en">
<title>HTMLSelectMenuElement Test: labels</title>
<link rel="author" title="Ionel Popescu" href="mailto:iopopesc@microsoft.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<label id="label1" for="selectmenu1">Label 1</label>
<selectmenu id="selectmenu1">
  <option>one</option>
  <option>two</option>
  <option>three</option>
  <option>four</option>
</selectmenu>
<label id="label2" for="selectmenu1">Label 2</label>
<label id="label3" for="invalid-selectmenu1">Label 3</label>

<script>

test(() => {
  let selectMenu = document.getElementById("selectmenu1");

  assert_true(selectMenu.labels instanceof NodeList);
  assert_equals(selectMenu.labels.length, 2);
  assert_equals(selectMenu.labels[0], document.getElementById("label1"));
  assert_equals(selectMenu.labels[1], document.getElementById("label2"));
}, "Validate selectmenu.labels");

</script>
