// Emit an event on each element, bubbling through compound ancestors to the core
eles.emit(events: string, extraParams?: unknown[]): thisEmit an event on each element, bubbling through compound ancestors to the core.
| Name | Description |
|---|---|
events: string | one or more space-separated event names |
extraParams: unknown[]? | extra arguments passed to each handler after the event object |
Returns
thisthis collection, for chaining
Example
cy.getElementById('a').one('example', event => console.log(event.type)); // "example"cy.getElementById('a').emit('example'); // logs 'example'Also spelled eles.trigger.