// Stop listening on each element of this collection
eles.off(events: string, callback?: EventHandler<NodeData, EdgeData>): thisStop listening on each element of this collection.
| Name | Description |
|---|---|
events: string | one or more space-separated event names |
callback: EventHandler<NodeData, EdgeData>? | the handler to remove; omit to remove every handler these elements have for |
Returns
thisthis collection, for chaining
Example
let count = 0;const handler = () => count++;cy.getElementById('a').on('example', handler);cy.getElementById('a').off('example', handler);cy.getElementById('a').emit('example');console.log(count); // 0Also spelled eles.removeListener.