MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / submit

Function submit

javascript/atoms/typescript/submit.ts:28–37  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

26// The method comes from the prototype because a control named or id'd
27// "submit" masks form.submit.
28function submit(element: Element): void {
29 const form = findForm(element)
30 if (!form) {
31 throw botError(NO_SUCH_ELEMENT, 'Element was not in a form, so could not submit.')
32 }
33 if (fire(form, EventType.SUBMIT, { submitter: null })) {
34 const win = (form.ownerDocument.defaultView || window) as Window & typeof globalThis
35 win.HTMLFormElement.prototype.submit.call(form)
36 }
37}
38
39// A control's form owner honours the form= attribute; anything else falls
40// back to the nearest ancestor form. Reading .form off a <form> itself would

Callers

nothing calls this directly

Calls 4

findFormFunction · 0.85
botErrorFunction · 0.85
fireFunction · 0.85
callMethod · 0.65

Tested by

no test coverage detected