DOM CustomEvent.detail Property
The detail property of a CustomEvent holds the data passed when the event was created.
Description
The read-only detail property returns the data passed in the detail option of the CustomEvent constructor. It can be any value, typically an object, and it's how custom events carry information to their listeners.
Since the same object is passed to every listener, any listener can read it, and changes made to it are visible to listeners that run later and to the code that dispatched the event. That can be used deliberately to collect responses, but it's usually clearer to keep detail read-only.
If no detail option is given, it's null. Regular Event objects don't have a detail property; it's specific to CustomEvent and a few built-in events, such as clicks, where it holds the click count.
Syntax
event.detailValue
Any value given in the detail option when the event was created.
Example
Browser Support
The following information will show you the current browser support for the CustomEvent.detail property. Hover over a browser icon to see the version that first introduced support for this property.
Desktop





Tablets & Mobile





