2022.1

Table Of Contents
empty()
Removes the contents (child elements and inner HTML) from one or more HTML elements,
which can be:
l The elements that match the selector of a script (see "results" on page958).
l One element that matches the selector of a script that runs for "Each matched element"
(see "this" on page877 and "Setting the scope of a script" on page395).
l The elements returned by a query in the template (see "query()" on page831).
Use "remove()" on page911 to remove the elements themselves.
Example
This script empties all Span elements found in the template.
results.empty();
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
<span></span> amet,
consectetuer adipiscing
elit.</p>
find()
find(textToFind)
Performs a deep search for textToFind in the children of each element, and returns a new result
set with elements that surround the occurrences.
textToFind
A String that contains the search text.
Page 898