← Back to release summary

'submitter' property of 'submit' event

Category
DOM
Type
New or changed feature
Status
Enabled by default (Chrome 81)
Intent stage
Evaluate readiness to ship

Summary

The 'submit' event, which is dispatched on form submission, gets its own interface, SubmitEvent, which has a 'submitter' property.

Motivation

Some web applications do their own form submission by preventDefault()ing 'submit' event. However, the event didn't tell which submit button triggered this submission. Adding 'submitter' property to the event enables application to refer to an entry data, the formaction attribute, the formenctype attribute, the formmethod attribute, and the formtarget attribute of the submitter button.

Standards & signals

Docs: N/A

Explainers: N/A

View on chromestatus.com