Events API

evt.has()

async

Validates whether all events, or specific events passed to it, are enabled, either globally or for the matched DOM elements.

  • Accepts arguments that contain event names as strings or arrays of strings.
    You can pass event names as individual arguments, as an array, or as a string separated by commas or spaces.
    Each value is seen as a new argument.
  • Returns true if all passed events or all events on matched DOM elements are enabled, otherwise, returns false.
Example:
// Validates whether all passed events are enabled globally.
await evt.has('click');
await evt.has('click', 'input');
await evt.has(['click', 'input']);
await evt.has('click, input');
await evt.has('click input');
// true | false

// Validates whether all events are disabled on the <div> element.
await $('div').evt.has();
// true | false

// Validates whether all events are disabled on all <div> elements.
await $('div ?').evt.has();
// true | false

// Validates whether all passed events are enabled on the <div> element.
await $('div').evt.has('click', 'input');
// true | false

// Validates whether all passed events are enabled on all <div> elements.
await $('div ?').evt.has('click', 'input');
// true | false