utils/dom

this module contains all the helper methods for dom manipulation or access
Author:
  • Aamir khan

Members

static, constant addScript

load a script from the given url
Author:
  • Aamir Khan

static, constant dispatchCustomEvent

dispatch a custom event on document object

static, constant newElement

creates a new dom element

static, constant on

add an even listener to an element given by the selector
Example
// specify the css selector followed by the event name with semilcolon in between
  const removePlayClick = on('#play:click', () => player.play());
  // to add listener on gloal document
  on(':keydown', (e) => {{);

static, constant select

a jquery like css dom selector which returns dom node