Class: DocumentListener

DocumentListener() → {DocumentListener}

new DocumentListener() → {DocumentListener}

Create a DocumentListener. Only one DocumentListener instance will be created in an application.

All DOM events are attached to the document and then filtered by selector.

Returns:

singleton

Type
DocumentListener

Methods

on(type, selector, listener, contextopt)

Add a DOM event listener.

Parameters:
Name Type Attributes Description
type string

The name of the event to listen on.

selector string

A valid CSS selector string which will be used in document.querySelectorAll.

listener function

The callback function for when this event is triggered.

context object <optional>

The value of 'this' provided to the listener.