About Pi Downloads Documentation Plugins Developer Forum Issues

pi.element.attribute.hasClass

Summary

Checks if the specified CSS class exists on the specified element's DOM node.

Syntax

element.hasClass(className);

Example

>>> MyButton.attribute.getClass();
"Foo Bar"
>>> MyButton.attribute.hasClass("Foo");
true
>>> MyButton.attribute.hasClass("Foo Bar");
false
>>> MyButton.attribute.hasClass("AngelineJolie");
false

See Also