Element.classNames returns the name of the class associated with element. Returns an empty string if there is no class associated with element.
script.aculo.us V1.5_rc5
Prototype V1.4.0_rc3
Element.classNames(element);
<a href="#" onclick="alert('Class name is:\n' + Element.classNames('test')); return false;">
Find out what the below paragraph's class is.</a>
<p id="test" class="fantastic">This is the best paragraph ever written!</p>
creates:
Find out what the below paragraph's class is.This is the best paragraph ever written!