2022.2

Table Of Contents
Function Description
"remove()"on
page810
RemovesanHTMLelementorasetofHTMLelementsfromthedocument.
"removeAttr()"on
page810
RemovesthespecifiedattributefromthecurrentHTMLelement.
"removeClass()"on
page811
RemovesthespecifiedclassfromthecurrentHTMLelement.Hasnoeffectiftheclassisnotpresent.
"replaceWith()"on
page811
ReplacesthecurrentHTMLelement(withasnippet,forexample).Returnsthecurrentelement.
"show()"onpage812 ShowstheHTMLelementinthetemplate.
"tagName()"on
page812
ReturnstheHTMLtagnameoftheelement,inuppercase.Foranexamplesee:"CreatingaTableOfContents"onpage411.
"text()"onpage813 ReplacesthetextcontentoftheHTMLelementwiththesuppliedvalue,orreturnsthetextcontentoftheelementifnovalueissup-
plied.
"width()"onpage813 GetsorsetstheouterwidthoftheHTMLelement,includingpaddingandborders.
add()
Theadd()functionaddselementstooneormoreHTMLelements,whichcanbe:
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).
add(content)
Theadd()functionaddsHTMLcontenttooneormoreHTMLelementsandreturnstheunionofthisres-
ultorresultsetandothercontent.
content
Aqueryresult.ThiscanbeanHTMLstringoraresultset.
Examples
Thisscriptaddsonequeryresulttoanotherandsetsthebackgroundcolortoyellow.
query("#test1").add(query("#test2")).css("background", "yellow");
Page 783