2021.1

Table Of Contents
Matched element Matched element after script
execution
<p>ipsumdolor sit amet, consectetur adipiscing
elit.</p>
<span>Lorem Ipsum</span>
<p id="salesrep">Peter Parker</p>
children()
Returns the immediate children (inner HTML) of one or more HTML elements, which can be:
l The elements that match the selector of a script (see "results" on page1427).
l One element that matches the selector of a script that runs for "Each matched element"
(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).
Examples
This script retrieves the inner HTML of an element selected from a snippet.
var snippet = loadhtml('snippets/snippet.html','#foobar').children
();
results.append(snippet);
The following script retrieves the inner HTML of the elements and then performs a find/replace.
var snippet = loadhtml('snippets/snippet.html','#foobar').children
();
snippet.find('@firstname@').text('foobar');
results.append(snippet);
clone()
This function returns a copy of one HTML element or of a set of HTML elements, which can be:
l The elements that match the selector of a script (see "results" on page1427).
l One element that matches the selector of a script that runs for "Each matched element"
(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: "Dynamically adding sections (cloning)" on page914.
Page 1360