$dom
DOM manipulation related helpers
Table of Contents
Methods
addChild
-
type
Creates a new child element relative to this HTML element
Parameters:
-
typeStringElement node type
addSibling
-
type
Adds a sibling element
Parameters:
-
typeStringElement node type
attr
-
name -
value
Gets/Sets the value for a given attribute of an HTML element
Parameters:
-
nameStringAttribute name
-
valueStringAttribute value
child
-
selector
Selects the first occurent of child elements that matches the selector
Parameters:
-
selectorStringElement's selector
Returns:
The element wraped in a helper object
create
-
type -
parent
Creates and returns an element
Parameters:
-
typeStringElement node type
-
parentHTMLElementElement's parent node
Returns:
The element wraped in a helper object
css
-
name -
value
Get/Sets the styling of a given element
Parameters:
-
nameStringStyle attribute
-
valueStringStyle value
css
-
name
Removes the styling attrribute of a given element
Parameters:
-
nameStringStyle attribute
get
-
selector
Gathers an element using a given selector query
Parameters:
-
selectorStringElement's selector
Returns:
The element wraped in a helper object
getById
-
id
Gathers an element using a given id
Parameters:
-
idStringElement'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:
-
containerHTMLElementThe element that contains the bounding rect we'll use to gather relative positioning data
-
evtEventThe event we're extracting information from
Returns:
Values
html
-
content
Gets\Sets the innerHTML content for the HTML element
Parameters:
-
contentString
html
-
content
Gets\Sets the innerText content for the HTML element
Parameters:
-
contentString
on
-
targetElement -
iteractionType -
triggerWrapper
Registers a delegate to a given element event
Parameters:
-
targetElementHTMLElementThe element that we're interested in
-
iteractionTypeStringThe event name
-
triggerWrapperFunctionThe 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