DOM related functions
- Source:
Methods
-
<static> addClass(el, cls)
-
Adds a class attribute
Parameters:
Name Type Description el
Node Element or string of element selector
cls
string the class value
- Source:
-
<static> empty(el)
-
Empty a element container
Parameters:
Name Type Description el
Node Element or string of element selector
- Source:
-
<static> getValue(el)
-
Gets the value of an element
Will detect the correct method to do so by element typeParameters:
Name Type Description el
Node Element or string of element selector
- Source:
Returns:
Returns the value of the element (or HTML)
- Type
- string
-
<static> getViewportHeight()
-
Gets the height of the browser viewport
- Source:
Returns:
The height of the viewport
- Type
- number
-
<static> getViewportWidth()
-
Gets the width of the browser viewport
- Source:
Returns:
The width of the viewport
- Type
- number
-
<static> hide(el)
-
Hides an element
Parameters:
Name Type Description el
Node Element or string of element selector
- Source:
-
<static> injectTemplate(template, mount)
-
injectTemplate method - Injects a template element at a mount point
Parameters:
Name Type Description template
string The template selector
mount
Node The mount point as Document.Element or String
- Source:
-
<static> query(query, el)
-
Query function
Supports full query selection but acts like jQueryParameters:
Name Type Description query
string Element or string of element selector
el
Node Element to start from (optional)
- Source:
Returns:
Returns all the nodes selected
- Type
- NodeList | Node
-
<static> removeClass(el, cls)
-
Remove a class attribute
Parameters:
Name Type Description el
Node Element or string of element selector
cls
string the class value
- Source:
-
<static> selector(query)
-
Selector function
Supports full query selectionParameters:
Name Type Description query
string Element or string of element selector
- Source:
Returns:
Returns the element (or first of type)
- Type
- Node
-
<static> selectors(query)
-
Selectors function
Supports full query selectionParameters:
Name Type Description query
string Element or string of element selector
- Source:
Returns:
Returns all the nodes selected
- Type
- NodeList
-
<static> setClass(el, cls)
-
Sets the class attribute (completely)
Parameters:
Name Type Description el
Node Element or string of element selector
cls
string the class value
- Source:
-
<static> setValue(el, value, onlyText)
-
Sets the value of an element
Will detect the correct method to do so by element typeParameters:
Name Type Description el
Node Element or string of element selector
value
string Value to set (or HTML)
onlyText
boolean Value will set as text only
- Source:
-
<static> show(el, display)
-
Shows an element
Parameters:
Name Type Description el
Node Element or string of element selector
display
string Value to set for 'display' property (optional)
- Source: