2021.1

Table Of Contents
(see "this" on page1345 and "Setting the scope of a script" on page874).
l The elements returned by a query in the template (see "query()" on page1299).
See also: "prepend()" on page1374.
append(content)
Inserts content as the last element at the end of one or more HTML elements. Append() creates
a new result set.
content
String, HTML string or result set to insert after the element(s). In case a plain text string is
provided, it is automatically wrapped in a <span> element to avoid orphan text nodes to
appear in the <body> element.
Examples
This script appends a paragraph to the results (the set of HTML elements that match the
selector of the script).
results.append("<p>Peter Parker</p>");
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>
This script appends a string to the results (the HTML elements that match the selector of the
script). The string is added to the end of the matched element(s) and wrapped in a Span
element.
results.append("Peter Parker");
Page 1354