2019.2

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 the elements in a result set.
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 new set containing a copy of each element in a set; see "Dynamically
adding sections (cloning)" on page895.
To duplicate an existing template element, clone it before calling append(); see "Examples" on
page1300.
Examples
This script performs an iteration over the elements in the results (the elements that match the
selector of the script).
var row = query("tbody tr", results).clone();
query("tbody", results).append(row);
Page 1306