Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/forms/the-textarea-element/textarea-validity-valueMissing-inside-datalist.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>textarea element with "required" attribute and empty value is considered "suffering from being missing" even if inside datalist element</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element:suffering-from-being-missing">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<datalist>
<textarea required></textarea>
</datalist>
<script>
test(() => {
const textarea = document.querySelector("textarea");
assert_true(textarea.validity.valueMissing);
assert_false(textarea.validity.valid);
});
</script>