summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/the-input-element/resources/image-submit-click.html
blob: 8461a03d7a5221d6d9899deeb63405d71a641872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<form>
  <input type="image" name="name" value="value">
</form>

<script>
"use strict";
if (window.location.search.startsWith("?name.x")) {
  // The action pointed to ourself, so the form submitted something
  window.parent.success(window.location.href);
} else {
  const input = document.querySelector("input");
  input.click();
}
</script>