2022.2

Table Of Contents
results.addClass("foo bar");
Selector Matched element Matched element after script execution
p <p>Helloworld</p> <pclass="foobar">Helloworld</p>
after()
InsertscontentafteroneormoreHTMLelements,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:"before()"onpage1248.
after(content)
InsertscontentafteroneormoreHTMLelementsandcreatesanewresultset.
content
String,HTMLstringorresultsettoinsertafterthematchedelements.Incaseaplaintextstringis
provided,itisautomaticallywrappedina<span>elementtoavoidorphantextnodestoappearinthe
<body>element.
Examples
ThisscriptlooksupanelementwiththeID#salesrepandinsertsaparagraphafterit.
query("#salesrep").after("<p>Lorem ipsum</p>");
Matched element Matched element after script execution
<pid="salesrep">PeterParker</p> <pid="salesrep">PeterParker</p>
<p>Loremipsum</p>
ThisscriptlooksupanelementwiththeID#salesrep,setsitstextcolortoredandinsertsaparagraph
afterit.
Page 1207