Utils.node
A module containing various methods from the Node
interface. These include methods to append, remove, replace and
clone nodes. For more, see the DOM 4 specification section 5.3
(Interface Node).
Utils.node.prepend
Method that wraps insertBefore
,
which in turn appends a node-like object before
another node-like object to a
parent node-like object.
parentNode
.
Return value: Object || null
Utils.node.prependList
Method takes an array-like object
and passes each element to prepend
.
parentNode
.
Return value: Object || null
Utils.node.append
Method that “appends” a node-like object
(via appendChild
) to a parent node-like object.
parentNode
.
Return value: Object || null
Utils.node.appendList
Method takes an array-like object
and passes each element to append
.
parentNode
.
Return value: Object || null
Utils.node.remove
Method that “removes” a node-like object
(via removeChild
) from a parent
node-like object.
parentNode
.
Return value: Object || null
Utils.node.replace
Method that “replaces” a node-like object
(via replaceChild
) with a new
node-like object on a parent
node-like object.
parentNode
.
Return value: Object || null
Utils.node.clone
Method that “clones” a node-like object
(via cloneNode
); performs a “shallow”
(one level) “clone” if deep is false; performs
a “deep” (recursive) “clone” if deep is true.
Return value: Object || null
Utils.node.getName
Method that retrieves a node-like object's
nodeName
property; returns property in lower case form if
lower is true; returns property in upper case form if upper
is false; returns `null` if not applicable.
nodeName
property
will be returned in lower case or upper case form.
Return value: String || null
Utils.node.getValue
Method that retrieves a node-like object's
nodeValue
property; returns `null` if not applicable.
Return value: String || null
Utils.node.setValue
Method that overwrites a node-like object's
nodeValue
property; returns `null` if not applicable.
nodeValue
property.
Return value: String || null