Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/forms/the-datalist-element/input-list-detached.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTMLInputElement list in a detached tree</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(() => {
const root = document.createElement("div");
const input = document.createElement("input");
input.setAttribute("list", "suggestions");
const datalist = document.createElement("datalist");
datalist.id = "suggestions";
root.append(input, datalist);
assert_equals(input.list, datalist);
}, "The list getter finds a datalist in a detached element tree");
</script>