2020.2

Table Of Contents
Since the results object also is the result of a query (for elements that match the selector of the
script), it can be passed as context. For example in a script with the selector ā€œtableā€.
var rows = query("tr", results);
query(html)
Creates a new HTML element on the fly from the provided string of raw HTML, and returns the
new element.
html
A String containing a HTML element. Tags that can contain other elements should be paired
with a closing tag.
Example
The following script adds a paragraph to the results (elements that match the selector of the
script).
var div = query( '<div>' );
for ( let i = 0; i < 5; i++ ){
var p = query( '<p>' );
p.text( 'This is number ' + i );
div.append( p );
}
results.after( div );
Tip
The Dynamic Attachment script uses this function to add an attachment to an Email
section; see "Email attachments" on page185.
record
The record object gives access to the record that is currently being merged with the template.
Page 806