2018.2

Table Of Contents
attributeName
String; the name of the attribute.
value
String; value for the attribute.
Examples
This script looks up an image in an element with the ID #calloutbox and sets its alternative text
to a value from a data field
var altText = record.fields.FavHobby;
query("#callout img").attr('alt', altText);
The following script sets the background color of a specific table cell in an email to red if the
value of the field TOTAL has a negative value in the current record.
if(record.fields.TOTAL<0) {
query("#total").attr("bgcolor","red");
}
before()
Insert content before each element in the set of HTML elements that match the selector of the
script or of another query in the template (see "query()" on page1158). See also: "Examples"
on page1111.
before(content)
Before(content) inserts content before each element in the set of elements that match the
script's selector. Before() creates a new result set.
content
String, HTML string or result set to insert after the elements. In case a plain text string is
provided, it is automatically wrapped in a <span> element to avoid orphan text nodes to
appear in the <body> element.
Page 1117