Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>Pattern dynamic value attribute change</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<input pattern="a" value="a">
<script>
test(function() {
let i = document.querySelector("input");
assert_false(i.matches(":invalid"));
i.pattern = "b";
assert_true(i.matches(":invalid"));
i.pattern = "(";
assert_false(i.matches(":invalid"));
}, "input validation is updated after pattern attribute change");
</script>