Event element selectors
This article describes the element selectors used with event listeners.
Most event listeners require that you specify which element on a page you want trigger the event listener. For example, configuring a click event to track when a visitor clicks on a specific ad banner or button, or when a visitor plays a specific embedded video.
Specify the element to track by element ID, class, or a complex selector.
||A form field to collect email address|
||Any form field|
||A form field named email in a
The event system uses the
Element.matches() method for the selector. For more information about this method, see Element.matches() at Mozilla Developer Network.
For more information about how to determine an element’s selector, see How to Determine the CSS Selector of an Element.
Thank you for your feedback!
This page was last updated: February 21, 2023