$dom
DOM manipulation related helpers
Table of Contents
Methods
addChild
-
type
Creates a new child element relative to this HTML element
Parameters:
-
type
StringElement node type
addSibling
-
type
Adds a sibling element
Parameters:
-
type
StringElement node type
attr
-
name
-
value
Gets/Sets the value for a given attribute of an HTML element
Parameters:
-
name
StringAttribute name
-
value
StringAttribute value
child
-
selector
Selects the first occurent of child elements that matches the selector
Parameters:
-
selector
StringElement's selector
Returns:
The element wraped in a helper object
create
-
type
-
parent
Creates and returns an element
Parameters:
-
type
StringElement node type
-
parent
HTMLElementElement's parent node
Returns:
The element wraped in a helper object
css
-
name
-
value
Get/Sets the styling of a given element
Parameters:
-
name
StringStyle attribute
-
value
StringStyle value
css
-
name
Removes the styling attrribute of a given element
Parameters:
-
name
StringStyle attribute
get
-
selector
Gathers an element using a given selector query
Parameters:
-
selector
StringElement's selector
Returns:
The element wraped in a helper object
getById
-
id
Gathers an element using a given id
Parameters:
-
id
StringElement's id
Returns:
The element wraped in a helper object
getParent
()
Gets the parent node for this element
getXYPositionFrom
-
container
-
evt
Gathers UI iteraction X/Y coordinates from an event
Parameters:
-
container
HTMLElementThe element that contains the bounding rect we'll use to gather relative positioning data
-
evt
EventThe event we're extracting information from
Returns:
Values
html
-
content
Gets\Sets the innerHTML content for the HTML element
Parameters:
-
content
String
html
-
content
Gets\Sets the innerText content for the HTML element
Parameters:
-
content
String
on
-
targetElement
-
iteractionType
-
triggerWrapper
Registers a delegate to a given element event
Parameters:
-
targetElement
HTMLElementThe element that we're interested in
-
iteractionType
StringThe event name
-
triggerWrapper
FunctionThe delegate
raw
()
HTMLElement
Retrieves the raw HTML element wraped by this helper
Returns:
The element itself
type
()
String
Get the node name for this element
Returns:
The node name for this element