2020.1

Table Of Contents
Examples
This script colors the text of the results (the set of HTML elements that match the selector of
the script) red and makes it bold.
results.css({'color' : 'red', 'font-weight' : 'bold'});
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 page1395).
l One element that matches the selector of a script that runs for "Each matched element"
(see "this" on page1317 and "Setting the scope of a script" on page849).
l The elements returned by a query in the template (see "query()" on page1275).
Use "remove()" on page1348 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>
Page 1338