2022.2

Table Of Contents
Examples
ThisscriptinsertsaheadingasthefirstelementinanelementthathastheID#box.
results.prepend("<h1>Personal information</h1>");
Selector Matched element Matched element after script execution
#box <divid="box">
<p>PeterParker</p>
</div>
<divid="box">
<h1>Personalinformation</h1>
<p>PeterParker</p>
</div>
Thisscriptinsertsaheadingasthefirstelementinanelementthathastheclassname.
results.prepend("<b>Name: </b>");
Selector Matched element Matched element after script execution
.name <div>
<h1>Personalinformation</h1>
<pclass="name">PeterParker</p>
</div>
<div>
<h1>Personalinformation</h1>
<pclass="name"><b>Name:</b>PeterParker</p>
</div>
Thisscriptinsertscontentinmultiple<div>elementsatthesametime.
results.prepend("<h1>Personal information</h1>");
Selector Matched element Matched element after script execution
div <divid="box">
<p>PeterParker</p>
</div>
<divid="box">
<p>PeterParker</p>
</div>
<divid="box">
<h1>Personalinformation</h1>
<p>PeterParker</p>
</div>
<divid="box">
<h1>Personalinformation</h1>
<p>PeterParker</p>
</div>
Thisscriptprependsasnippetthatcontainsthetext"<h1>Personalinformation</h1>".
Page 1229