summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/the-selectlist-element/selectlist-listbox-element-ref.html
blob: 5533a97f603d8ad333a8763db15e47f1a07ee83b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<script src="support/fake-selectlist.js"></script>
<body>
<script>
const selectlist = createFakeSelectlist('button', /*includeListbox=*/true);
document.body.appendChild(selectlist);

selectlist.querySelector('button').remove();
selectlist.insertAdjacentHTML('afterbegin', `<button>button</button>`);

const listbox = selectlist.querySelector('.fake-selectlist-listbox');
listbox.innerHTML = `
  <option id=optone tabindex=0>one</option>
  <option>two</option>
`;
document.getElementById('optone').focus();
</script>