2022.2

Table Of Contents
Matched element Matched element after script execution
<pid="salesrep">PeterParker</p> <pid="salesrep">PeterParker</p>
<p>Loremipsum</p>
Thisscriptlooksforthestring"Lorem"intheresults(thesetofHTMLelementsthatmatchtheselector
ofthescript)andinsertsthestring"ipsum"rightafterthattext.Thestringisautomaticallyenclosedina
span.
results.find("Lorem ").after("ipsum");
Matched element Matched element after script execution
<p>Loremdolorsitamet,consecteturadipiscingelit.</p> <p>Lorem<span>ipsum</span>dolorsitamet,consecteturadipiscingelit.</p>
ThisscriptlooksupanelementwiththeID#salesrepandinsertsastringafterit.Thestringisauto-
maticallyenclosedinaspan.
query("#salesrep").after("Lorem Ipsum");
Matched element Matched element after script execution
<pid="salesrep">PeterParker</p> <pid="salesrep">PeterParker</p>
<span>LoremIpsum</span>
append()
InsertcontentattheendofoneormoreHTMLelements,whichcanbe:
l
Theelementsthatmatchtheselectorofascript(see"results"onpage844).
l
Oneelementthatmatchestheselectorofascriptthatrunsfor"Eachmatchedelement"(see
"this"onpage781and"Settingthescopeofascript"onpage373).
l
Theelementsreturnedbyaqueryinthetemplate(see"query()"onpage742).
Seealso:"prepend()"onpage806.
Page 787