2018.2

Table Of Contents
text()
text() : String
Returns the text content of the first element in a result set.
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 each element in a result set by 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);
each()
A generic iterator function, to iterate over the elements in the result set.
each(callback)
Iterates over the elements in a set, such as the enumerable properties of an object, in arbitrary
order. For each distinct property, statements can be executed.
callback
Page 1136