chromium/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-input-element/resources/image-submit-click.html

<!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>