Skip to content

Tag: dom-events

Listen to a specific data attribute in events

I need to listen to a message event that will have a data attribute and depending on this attribute do different actions. Now, I want to test this with a button by dispatching such an event. However, I can only find the detail attribute, but not how to set the data attribute: and How can I send with the data