Wrapper for a Node.
https://www.w3.org/TR/dom/#node
Construct a new xjs_Node object.
the node to wrap
The wrapped DOM Node.
This wrapper’s node.
Remove all child nodes from this node, and return it.
this
Execute a function acting on this node, and then return this node.
Simplifies chaining when performing void tasks, especially tasks that have not been defined in this implementation.
any function that takes 0 arguments and returns undefined (or does not have a return statement)
undefined
Get Node#textContent.
https://www.w3.org/TR/dom/#dom-node-textcontent
the textContent of this node
textContent
Set Node#textContent, and returns this object when done.
This method exists simply for chaining.
the content to set
Remove all inner whitespace text nodes from this node, and return it.
let snip = new HTMLElement(document.createElement('div')).addContent(<h1> <em>Hello </em> <b>Worl d</b> </h1>) let snipTrimmed = new xjs.Node(snip).trimInner() return snip.node.innerHTML === <h1> <em>Hello </em> <b>Worl d</b> </h1> && snipTrimmed.node.innerHTML = <h1><em>Hello </em><b>Worl d</b></h1>
<h1> <em>Hello </em> <b>Worl d</b> </h1>
<h1><em>Hello </em><b>Worl d</b></h1>
Generated using TypeDoc
Wrapper for a Node.
https://www.w3.org/TR/dom/#node