2021.2

Table Of Contents
Example
This script loads a snippet into a variable and retrieves an element from the snippet using query
() and text().
var mysnippet = loadhtml('snippets/text-root-wrapped.html');
var subject = query("#subject", mysnippet).text();
results.append("<p style='font-weight: bold;'>" + subject +
"</p>");
text(value)
Replaces the text content of one HTML element or of each element in a result set with the
supplied value.
Example
This script loads a snippet, then looks for placeholders using find(), and replaces them using
text(value).
var mysnippet = loadhtml('snippets/snippet.html');
mysnippet.find('@var1@').text('OL Connect 1');
mysnippet.find('@var2@').html('<i>OL Connect 2</i>').css('text-
decoration','underline');
results.replaceWith(mysnippet);
width()
Gets or sets the outer width, including padding and borders, of an HTML element or of the first
element in result set (see "results" on page1448), i.e. the set of HTML elements that match the
selector of the script or of another query in the template (see "query()" on page1319).
width(): Number
Returns the outer width of this element, including padding and borders, excluding margins. To
include margins, call width(true).
The returned value is the width in pixels, without measurement unit (e.g. 400).
Page 1403