1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23

content / test / data / accessibility / event / report-validity-invalid-field.html [blame]

<!--
@WIN-DENY:*
@WIN-ALLOW:EVENT_OBJECT_FOCUS*
@WIN-ALLOW:EVENT_SYSTEM_ALERT*
@WIN-ALLOW:EVENT_OBJECT_LIVE*
@UIA-WIN-DENY:*
@UIA-WIN-ALLOW:AutomationFocusChanged*
@MAC-DENY:*
@MAC-ALLOW:AXFocusedUIElementChanged
@MAC-ALLOW:AXFocusedUIElementChanged
@MAC-ALLOW:AXLiveRegion
-->
<!DOCTYPE html>
<form>
  <label for="in1">Pet name:</label><input id="in1" required>
</form>
<script>
  function go() {
    const in1 = document.querySelector('input');
    in1.setCustomValidity('Please enter pet name');
    in1.reportValidity();
  }
</script>