Module: common-sk/modules/dom

Members

(static, constant) DomReady

A Promise that resolves when DOMContentLoaded has fired.
Source:

Methods

(static) findParent(ele, nodeName) → {HTMLElement}

Find the first parent of 'ele' with the given 'nodeName'.
Parameters:
Name Type Description
ele HTMLElement The element to start searching a.
nodeName string The node name we are looking for.
Source:
Returns:
Either 'ele' or the first parent of 'ele' that has the nodeName of 'nodeName'.
Type
HTMLElement
Example
findParent(ele, 'DIV')

(inner) $(query, ele) → {Array}

Returns a real JS array of DOM elements that match the CSS selector.
Parameters:
Name Type Description
query string CSS selector string.
ele Element The Element to start the search from.
Source:
Returns:
Array of DOM Elements that match the CSS selector.
Type
Array

(inner) $$(query, ele) → {Element}

Returns the first DOM element that matches the CSS query selector.
Parameters:
Name Type Description
query string CSS selector string.
ele Element The Element to start the search from.
Source:
Returns:
The first Element in DOM order that matches the CSS selector.
Type
Element