2021.2

Table Of Contents
l The first element in a set of elements that match the selector of a script (see "results" on
page1448).
l One element that matches the selector of a script that runs for "Each matched element"
(see "this" on page1364 and "Setting the scope of a script" on page883).
l The first element in a set of elements returned by a query in the template (see "query()" on
page1319).
html(value)
Replaces the inner HTML of an HTML element or of each element in a result set with the
supplied value.
value
A String that may contain HTML tags.
Examples
The following script loads part of a snippet based on the value of a field, and then inserts the
content into the document using html().
var promoTxt = loadhtml('snippets/promo-en.html', '#' +
record.fields['YOGA']);
results.html(promoTxt);
The following script loads a snippet. Then it looks for a placeholder (@var2@) in the text of that
snippet and replaces every found placeholder by the text '<i>OL Connect 1</i>'. It uses html()
so the HTML formatting (<i> and </i>) will indeed be interpreted as HTML. Finally, it places the
snippet in the template.
var mysnippet = loadhtml('snippets/snippet.html');
mysnippet.find('@var1@').html('<i>OL Connect 1</i>');
results.replaceWith(mysnippet);
info()
Returns pagination information for one HTML element or for the first element in a result set (see
"results" on page1448) of a query across all sections in a Print context (see "query(selector)"
on page1446).
The returned information is of the type PaginationInfo (see "PaginationInfo" on page1447).
Page 1389