1.8

Table Of Contents
addClass()
Adds the specified class(es) to each element in a set of HTML elements that match the selector
of the script or of another query in the template (see "query()" on page926).This has no effect if
the class is already present.
addClass(classname)
Adds the specified class(es) to each element in a result set. Has no effect if the class is already
present.
classname
String, space separated list of class names.
Examples
This script adds a class name to a paragraph.
results.addClass("foo");
Selector Matched element Matched element after script execution
p <p>Hello world</p> <p class="foo bar">Hello world</p>
The following script adds two class names to a paragraph.
results.addClass("foo bar");
Selector Matched element Matched element after script execution
p <p>Hello world</p> <p class="foo bar">Hello world</p>
after()
Insert contentafter 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926).See also: " Examples" on
page890.
Page 883