Function
private method for inserting queried nodes into all nodes in this NodeList at different positions. Differs from NodeList.place because it will clone the nodes in this NodeList if the query matches more than one element.
dojo.NodeList
Function
allows setting the innerHTML of each node in the NodeList, if there is a value passed in, otherwise, reads the innerHTML value of the first node.
This method is simpler than the dojo.NodeList.html() method provided by `dojo.NodeList-html`. This method just does proper innerHTML insertion of HTML fragments, and it allows for the innerHTML to be read for the first node in the node list. Since dojo.NodeList-html already took the "html" name, this method is called "innerHTML". However, if dojo.NodeList-html has not been loaded yet, this module will define an "html" method that can be used instead. Be careful if you are working in an environment where it is possible that dojo.NodeList-html could have been loaded, since its definition of "html" will take precedence. The nodes represented by the value argument will be cloned if more than one node is in this NodeList. The nodes in this NodeList are returned in the "set" usage of this method, not the HTML that was inserted.
if no value is passed, the result is String, the innerHTML of the first node. If a value is passed, the return is this dojo.NodeList
dojo.NodeList|String
assume a DOM created by this markup: <div id="foo"></div> <div id="bar"></div> This code inserts <p>Hello World</p> into both divs: dojo.query("div").innerHTML("<p>Hello World</p>");
assume a DOM created by this markup: <div id="foo"><p>Hello Mars</p></div> <div id="bar"><p>Hello World</p></div> This code returns "<p>Hello Mars</p>": var message = dojo.query("div").innerHTML();
Function
optional. The HTML fragment to use as innerHTML. If value is not passed, then the innerHTML of the first element in this NodeList is returned.
see the information for "innerHTML". "html" is an alias for "innerHTML", but is only defined if dojo.NodeList-html has not been loaded.
An alias for the "innerHTML" method, but only defined if there is not an existing "html" method on dojo.NodeList. Be careful if you are working in an environment where it is possible that dojo.NodeList-html could have been loaded, since its definition of "html" will take precedence. If you are not sure if dojo.NodeList-html could be loaded, use the "innerHTML" method.
if no value is passed, the result is String, the innerHTML of the first node. If a value is passed, the return is this dojo.NodeList
dojo.NodeList|String
Function
allows setting the text value of each node in the NodeList, if there is a value passed in, otherwise, returns the text value for all the nodes in the NodeList in one string.
if no value is passed, the result is String, the text value of the first node. If a value is passed, the return is this dojo.NodeList
dojo.NodeList|String
assume a DOM created by this markup: <div id="foo"></div> <div id="bar"></div> This code inserts "Hello World" into both divs: dojo.query("div").text("Hello World");
assume a DOM created by this markup: <div id="foo"><p>Hello Mars <span>today</span></p></div> <div id="bar"><p>Hello World</p></div> This code returns "Hello Mars today": var message = dojo.query("div").text();
Function
Hello World
into both divs:Hello World
");Hello Mars
Hello World
Hello Mars
":Hello Mars today
Hello World
If a value is passed, allows seting the value property of form elements in this NodeList, or properly selecting/checking the right value for radio/checkbox/select elements. If no value is passed, the value of the first node in this NodeList is returned.
if no value is passed, the result is String or an Array, for the value of the first node. If a value is passed, the return is this dojo.NodeList
DOMNode|dojo.NodeList|String|String||Array
Function
appends the content to every node in the NodeList.
The content will be cloned if the length of NodeList is greater than 1. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the appended content.
dojo.NodeList
assume a DOM created by this markup: <div id="foo"><p>Hello Mars</p></div> <div id="bar"><p>Hello World</p></div> Running this code: dojo.query("div").append("<span>append</span>"); Results in this DOM structure: <div id="foo"><p>Hello Mars</p><span>append</span></div> <div id="bar"><p>Hello World</p><span>append</span></div>
Function
appends nodes in this NodeList to the nodes matched by the query passed to appendTo.
The nodes in this NodeList will be cloned if the query matches more than one element. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the matched nodes from the query.
dojo.NodeList
assume a DOM created by this markup: <span>append</span> <p>Hello Mars</p> <p>Hello World</p> Running this code: dojo.query("span").appendTo("p"); Results in this DOM structure: <p>Hello Mars<span>append</span></p> <p>Hello World<span>append</span></p>
Function
prepends the content to every node in the NodeList.
The content will be cloned if the length of NodeList is greater than 1. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the appended content. assume a DOM created by this markup: <div id="foo"><p>Hello Mars</p></div> <div id="bar"><p>Hello World</p></div> Running this code: dojo.query("div").prepend("<span>prepend</span>"); Results in this DOM structure: <div id="foo"><span>prepend</span><p>Hello Mars</p></div> <div id="bar"><span>prepend</span><p>Hello World</p></div>
dojo.NodeList
Function
prepends nodes in this NodeList to the nodes matched by the query passed to prependTo.
The nodes in this NodeList will be cloned if the query matches more than one element. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the matched nodes from the query.
dojo.NodeList
assume a DOM created by this markup: <span>prepend</span> <p>Hello Mars</p> <p>Hello World</p> Running this code: dojo.query("span").prependTo("p"); Results in this DOM structure: <p><span>prepend</span>Hello Mars</p> <p><span>prepend</span>Hello World</p>
Function
Places the content after every node in the NodeList.
The content will be cloned if the length of NodeList is greater than 1. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the appended content.
dojo.NodeList
assume a DOM created by this markup: <div id="foo"><p>Hello Mars</p></div> <div id="bar"><p>Hello World</p></div> Running this code: dojo.query("div").after("<span>after</span>"); Results in this DOM structure: <div id="foo"><p>Hello Mars</p></div><span>after</span> <div id="bar"><p>Hello World</p></div><span>after</span>
Function
The nodes in this NodeList will be placed after the nodes matched by the query passed to insertAfter.
The nodes in this NodeList will be cloned if the query matches more than one element. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the matched nodes from the query.
dojo.NodeList
assume a DOM created by this markup: <span>after</span> <p>Hello Mars</p> <p>Hello World</p> Running this code: dojo.query("span").insertAfter("p"); Results in this DOM structure: <p>Hello Mars</p><span>after</span> <p>Hello World</p><span>after</span>
Function
Places the content before every node in the NodeList.
The content will be cloned if the length of NodeList is greater than 1. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the appended content.
dojo.NodeList
assume a DOM created by this markup: <div id="foo"><p>Hello Mars</p></div> <div id="bar"><p>Hello World</p></div> Running this code: dojo.query("div").before("<span>before</span>"); Results in this DOM structure: <span>before</span><div id="foo"><p>Hello Mars</p></div> <span>before</span><div id="bar"><p>Hello World</p></div>
Function
The nodes in this NodeList will be placed after the nodes matched by the query passed to insertAfter.
The nodes in this NodeList will be cloned if the query matches more than one element. Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes currently in this NodeList will be returned, not the matched nodes from the query.
dojo.NodeList
assume a DOM created by this markup: <span>before</span> <p>Hello Mars</p> <p>Hello World</p> Running this code: dojo.query("span").insertBefore("p"); Results in this DOM structure: <span>before</span><p>Hello Mars</p> <span>before</span><p>Hello World</p>
Function
single-expression CSS rule. For example, ".thinger" or "#someId[attrName='value']" but not "div > span". In short, anything which does not invoke a descent to evaluate but can instead be used to test a single node is acceptable.
alias for dojo.NodeList's orphan method. Removes elements in this list that match the simple filter from their parents and returns them as a new NodeList.
dojo.NodeList
dojo.NodeList
Function
Wrap each node in the NodeList with html passed to wrap.
html will be cloned if the NodeList has more than one element. Only DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes in the current NodeList will be returned, not the nodes from html argument.
dojo.NodeList
assume a DOM created by this markup: <b>one</b> <b>two</b> Running this code: dojo.query("b").wrap("<div><span></span></div>"); Results in this DOM structure: <div><span><b>one</b></span></div> <div><span><b>two</b></span></div>
Function
Insert html where the first node in this NodeList lives, then place all nodes in this NodeList as the child of the html.
dojo.NodeList, the nodes in the current NodeList will be returned, not the nodes from html argument.
dojo.NodeList
assume a DOM created by this markup: <div class="container"> <div class="red">Red One</div> <div class="blue">Blue One</div> <div class="red">Red Two</div> <div class="blue">Blue Two</div> </div> Running this code: dojo.query(".red").wrapAll('<div class="allRed"></div>'); Results in this DOM structure: <div class="container"> <div class="allRed"> <div class="red">Red One</div> <div class="red">Red Two</div> </div> <div class="blue">Blue One</div> <div class="blue">Blue Two</div> </div>
Function
For each node in the NodeList, wrap all its children with the passed in html.
html will be cloned if the NodeList has more than one element. Only DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, the nodes in the current NodeList will be returned, not the nodes from html argument.
dojo.NodeList
assume a DOM created by this markup: <div class="container"> <div class="red">Red One</div> <div class="blue">Blue One</div> <div class="red">Red Two</div> <div class="blue">Blue Two</div> </div> Running this code: dojo.query(".red").wrapInner('<span class="special"></span>'); Results in this DOM structure: <div class="container"> <div class="red"><span class="special">Red One</span></div> <div class="blue">Blue One</div> <div class="red"><span class="special">Red Two</span></div> <div class="blue">Blue Two</div> </div>
Function
Replaces each node in ths NodeList with the content passed to replaceWith.
The content will be cloned if the length of NodeList is greater than 1. Only the DOM nodes are cloned, not any attached event handlers.
The nodes currently in this NodeList will be returned, not the replacing content. Note that the returned nodes have been removed from the DOM.
dojo.NodeList
assume a DOM created by this markup: <div class="container"> <div class="red">Red One</div> <div class="blue">Blue One</div> <div class="red">Red Two</div> <div class="blue">Blue Two</div> </div> Running this code: dojo.query(".red").replaceWith('<div class="green">Green</div>'); Results in this DOM structure: <div class="container"> <div class="green">Green</div> <div class="blue">Blue One</div> <div class="green">Green</div> <div class="blue">Blue Two</div> </div>
Function
replaces nodes matched by the query passed to replaceAll with the nodes in this NodeList.
The nodes in this NodeList will be cloned if the query matches more than one element. Only the DOM nodes are cloned, not any attached event handlers.
The nodes currently in this NodeList will be returned, not the matched nodes from the query. The nodes currently in this NodeLIst could have been cloned, so the returned NodeList will include the cloned nodes.
dojo.NodeList
assume a DOM created by this markup: <div class="container"> <div class="spacer">___</div> <div class="red">Red One</div> <div class="spacer">___</div> <div class="blue">Blue One</div> <div class="spacer">___</div> <div class="red">Red Two</div> <div class="spacer">___</div> <div class="blue">Blue Two</div> </div> Running this code: dojo.query(".red").replaceAll(".blue"); Results in this DOM structure: <div class="container"> <div class="spacer">___</div> <div class="spacer">___</div> <div class="red">Red One</div> <div class="red">Red Two</div> <div class="spacer">___</div> <div class="spacer">___</div> <div class="red">Red One</div> <div class="red">Red Two</div> </div>
Function
Hello World
into both divs:Hello World
");Hello Mars
Hello World
Hello Mars
":Hello Mars today
Hello World
Hello Mars
Hello World
Hello Mars
appendHello World
appendHello Mars
Hello World
Hello Marsappend
Hello Worldappend
Hello Mars
Hello World
Hello Mars
Hello World
Hello Mars
Hello World
prependHello Mars
prependHello World
Hello Mars
Hello World
Hello Mars
Hello World
Hello Mars
Hello World
Hello Mars
afterHello World
afterHello Mars
Hello World
Hello Mars
Hello World
Hello Mars
Hello World
Hello Mars
Hello World
Clones all the nodes in this NodeList and returns them as a new NodeList.
Only the DOM nodes are cloned, not any attached event handlers.
dojo.NodeList, a cloned set of the original nodes.
DOMNode|dojo.NodeList|String|String||Array
Object
Object