summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/the-button-element/button-setcustomvalidity.html
blob: 1747bd727aa2fb4deb8f2a81601523776a51a355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE HTML>
<title>button setCustomValidity</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<button id='button_test'></button>

<script>

test(() => {
  let elem = document.getElementById("button_test");
  assert_false(elem.validity.customError);
  elem.setCustomValidity("custom error");
  assert_true(elem.validity.customError);
}, "button setCustomValidity is correct")

</script>