define and use custom js event code example
Example: custom event js
const eventDetails = {
'id': elemId
}
document.dispatchEvent (
new CustomEvent('myCustomEvent', {'detail': eventDetails})
)
const eventDetails = {
'id': elemId
}
document.dispatchEvent (
new CustomEvent('myCustomEvent', {'detail': eventDetails})
)