Constructor
new NodeList(parent, …nodes)
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
parent |
Container | ||
nodes |
Array.<Node> |
<repeatable> |
Extends
- Array
Members
innerHTML
- Source:
Return the innerHTML of the current Container as a String.
Example
container.innerHTML // returns a string of innerHTML
innerHTML
- Source:
Define the nodes of the current NodeList from a String.
Example
nodeList.innerHTML = 'Hello <strong>world</strong>';
nodeList.length; // 2
parent
- Source:
Return the parent of the current NodeList.
textContent
- Source:
Return the text content of the current NodeList as a String.
textContent
- Source:
Methods
(static) from(nodes)
- Source:
Return a new NodeList from an object.
Example
Return a NodeList from an array of text.
NodeList.from([ 'test' ]) // returns NodeList [ Text { data: 'test' } ]
Parameters:
Name | Type | Description |
---|---|---|
nodes |
Node | Array.<Node> | Array or object of nodes. |
clone(parent) → {NodeList}
- Source:
Return a clone of the current NodeList.
Parameters:
Name | Type | Description |
---|---|---|
parent |
Node | New parent containing the cloned NodeList. |
Returns:
- Type
- NodeList
pop() → {Node}
- Source:
Returns:
- Type
- Node
push() → {number}
- Source:
Returns:
- Type
- number
shift() → {Node}
- Source:
Returns:
- Type
- Node
splice()
- Source:
toJSON() → {Array.<(Node|string)>}
- Source:
Return the current NodeList as an Array.
Example
nodeList.toJSON() // returns []
Returns:
- Type
- Array.<(Node|string)>
toString()
- Source:
Return the current NodeList as a String.
Example
nodeList.toString() // returns ''
unshift()
- Source: