2022.2

Table Of Contents
Matched element Matched element after script execution
<p>ipsumdolorsitamet,consecteturadipiscingelit.</p> <span>LoremIpsum</span>
<pid="salesrep">PeterParker</p>
children()
Returnstheimmediatechildren(innerHTML)ofoneormoreHTMLelements,whichcanbe:
l
Theelementsthatmatchtheselectorofascript(see"results"onpage1301).
l
Oneelementthatmatchestheselectorofascriptthatrunsfor"Eachmatchedelement"(see
"this"onpage1237and"Settingthescopeofascript"onpage813).
l
Theelementsreturnedbyaqueryinthetemplate(see"query()"onpage1197).
Examples
ThisscriptretrievestheinnerHTMLofanelementselectedfromasnippet.
var snippet = loadhtml('snippets/snippet.html','#foobar').children();
results.append(snippet);
ThefollowingscriptretrievestheinnerHTMLoftheelementsandthenperformsafind/replace.
var snippet = loadhtml('snippets/snippet.html','#foobar').children();
snippet.find('@firstname@').text('foobar');
results.append(snippet);
clone()
ThisfunctionreturnsacopyofoneHTMLelementorofasetofHTMLelements,whichcanbe:
l
Theelementsthatmatchtheselectorofascript(see"results"onpage1301).
l
Oneelementthatmatchestheselectorofascriptthatrunsfor"Eachmatchedelement"(see
"this"onpage1237and"Settingthescopeofascript"onpage813).
l
Theelementsreturnedbyaqueryinthetemplate(see"query()"onpage1197).
Seealso:"Dynamicallyaddingsections(cloning)"onpage846.
Toduplicateanexistingtemplateelement,cloneitbeforecallingappend();see"append()"on
page1244.
Examples
Thisscriptperformsaniterationovertheelementsintheresults(theelementsthatmatchthe
selectorofthescript).
Page 1250