2019.2

Table Of Contents
This code is used in a script that inserts a table of contents. For the full script and explanation
see "Creating a Table Of Contents" on page428.
hasClass()
hasClass(classname) : Boolean
Returns true if the first element in this result set has the specified class.
classname
String containing one class name.
Example
This script checks if the first of the results (the set of elements matching the selector of the
script) has the class 'green'. If so, it colors the text of all the elements in the results green.
if (results.hasClass('green')) {
results.css('color', 'green');
}
height()
Gets or sets the outer height, including padding and borders, of the first element in the results
(see "results" on page902), 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863).
height(): Number
Returns the outer height of this element, including padding and borders, excluding margins. To
include margins, call height(true).
The returned value is the height in pixels, without measurement unit (e.g. 400).
height(value): void
Sets the outer height of this element, including padding and borders, excluding margins. To
include margins, call height(value, true).
value
Number. Give the height in pixels, but without the measurement unit (e.g. 400, not 400px).
Page 829