2022.2

Table Of Contents
Selector Matched element Matched element after script execution
#box <divid="box">
<h1>Personalinformation</h1>
</div>
<divid="box">
<h1>Personalinformation</h1>
<p>PeterParker</p>
</div>
Thisscriptappendsastringtotheresults(theHTMLelementsthatmatchtheselectorofthescript).
Thestringisaddedtotheendofthematchedelement(s)andwrappedinaSpanelement.
results.append("Peter Parker");
Selector Matched element Matched element after script execution
.name <div>
<h1>Personalinformation</h1>
<pclass="name"><b>Name:</b></p>
</div>
<div>
<h1>Personalinformation</h1>
<pclass="name"><b>Name:</b><span>PeterParker</span></p>
</div>
Thisscript'sselectoris<div>,sothescriptappendsaparagraphtoallDivelementsinthetemplate.
results.append("<p>Peter Parker</p>");
Selector Matched element Matched element after script execution
div <div>
<h1>Personalinformation</h1>
</div>
<div>
<h1>Personalinformation</h1>
</div>
<div>
<h1>Personalinformation</h1>
<p>PeterParker</p>
</div>
<div>
<h1>Personalinformation</h1>
<p>PeterParker</p>
</div>
ThefollowingscriptappendsasnippettoaDivelementwiththeIDbox.
var a = loadhtml('snippets/snippet_name.html');
results.append(a);
Page 1245