Label API

The label API can be used to add text elements into the visualization.

.label(msg, options)

This is a method of the JSAV object. It creates a label that is associated with some UI element of the AV specified by the options. Parameter msg is the (initial) value for the label. Parameter options include the following:

.hide()

Make the label invisible.

.show()

Make the label visible.

.text(msg)

Set the text for the label. If the msg parameter is left out, this method will return the current text of the label.

.clear()

Removes the DOM element of this label from the document. This is useful, for example, in re-initializing exercises when the existing label needs to be removed.

.addClass(className, [options])

Adds the CSS class className to the label and animates the changes.

.removeClass(className, [options])

Removes the CSS class className from the label and animates the changes.

.toggleClass(className, [options])

Toggles the CSS class className of the label and animates the changes.

.hasClass(className, [options])

Return true/false based on if the label has the CSS class className.