(id: string, root?: ShadowRoot | Document)
| 8 | * @public |
| 9 | */ |
| 10 | export function submitForm(id: string, root?: ShadowRoot | Document): void { |
| 11 | const formElement = (root || document).getElementById(id) |
| 12 | if (formElement instanceof HTMLFormElement) { |
| 13 | const event = new Event('submit', { cancelable: true, bubbles: true }) |
| 14 | formElement.dispatchEvent(event) |
| 15 | return |
| 16 | } |
| 17 | warn(151, id) |
| 18 | } |