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

Function findForm

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

Source from the content-addressed store, hash-verified

40// back to the nearest ancestor form. Reading .form off a <form> itself would
41// find a control named "form" instead.
42function findForm(element: Element): HTMLFormElement | null {
43 if (element.tagName.toUpperCase() === 'FORM') {
44 return element as HTMLFormElement
45 }
46 const owner = (element as HTMLInputElement).form
47 if (owner) {
48 return owner
49 }
50 return element.closest('form')
51}
52
53export default submit

Callers 1

submitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected