ParentNode#append, but return this object when done.
This method exists simply for chaining.
let strong = document.createElement('strong')
strong.textContent = 'hello'
let em = document.createElement('em')
let mark = document.createElement('mark')
this.append(...[
strong, // DOM Node
` to the `, // string
new Comment(`great`), // DOM Node
`<small>big</small> `, // string with HTML
new xjs.Element(em).addContent(`world`).node, // DOM Node (unwrapped)
null, // null
new xjs.Element(mark).addContent(`!`), // wrapped DOM Node
]).node.querySelector('body').innerHTML
// `<strong>hello</strong> to the <!--great--><small>big</small> <em>world</em><mark>!</mark>`
the contents to append
this
ParentNode#prepend, but return this object when done.
This method exists simply for chaining.
let strong = document.createElement('strong')
strong.textContent = 'hello'
let em = document.createElement('em')
let mark = document.createElement('mark')
this.prepend(...[
strong, // DOM Node
` to the `, // string
new Comment(`great`), // DOM Node
`<small>big</small> `, // string with HTML
new xjs.Element(em).addContent(`world`).node, // DOM Node (unwrapped)
null, // null
new xjs.Element(mark).addContent(`!`), // wrapped DOM Node
]).node.querySelector('body').innerHTML
// `<strong>hello</strong> to the <!--great--><small>big</small> <em>world</em><mark>!</mark>`
the contents to prepend
this
ParentNode#querySelector, but return the wrapped element.
the selector of the element to match
the first matched element, wrapped, or null
if there is no match
ParentNode#querySelectorAll, but return an array of wrapped elements.
the selector of the element(s) to match
a (possibly empty) array of matched elements, wrapped
Generated using TypeDoc
Wrapper for a ParentNode.
https://www.w3.org/TR/dom/#interface-parentnode