Web APIs
CustomEvent.detail
Exposes the data supplied when constructing a custom event. It is not automatically cloned or validated.
Formal Syntax & Structure
javascript syntaxjavascript
event.detailReturn Value
unknown
Payload, or null by default.
Working Example
Example Snippetjavascript
const e=new CustomEvent("saved",{detail:{id:3}}); console.log(e.detail.id);