2021.1

Table Of Contents
results object (see "results" on page1427). The following script changes the font-weight of the
previous paragraph - the first paragraph in the Box - to bold.
results.prev().css("font-weight", "bold");
If the elements in results don't have siblings, this line of code will have no effect. It also won't
result in an error.
In an 'Each matched element' script you would first need to check the return value of this.prev
():
var prevSibling = this.prev();
if prevSibling != null { prevSibling.css("font-weight", "bold"); }
remove()
Removes the current element or each element in a set from the DOM.
This function returns a new result set containing each removed element. These can be
changed and inserted in the document. This could be beneficial in terms of performance, as
manipulating elements inside the DOM is relatively time consuming.
Examples
This script removes all Span elements found in the template.
results.remove();
Selector Paragraph
before script
execution
Paragraph after
script execution
span <p>Lorem ipsum
<span>dolor
sit</span> amet,
consectetuer
adipiscing
elit.</p>
<p>Lorem ipsum
amet, consectetuer
adipiscing elit.</p>
Page 1339