Element.has\ClassName Returns true if element has a class name corresponding to className and false otherwise.
script.aculo.us V1.5_rc5
Prototype V1.4.0_rc3
Element.hasClassName(element, className);
<a href="#" onclick="alert(Element.hasClassName('test', 'fantastic')); return false;">
does the below paragraph's class correspond to "fantastic"?</a>
<p id="test" class="fantastic">This is the best paragraph ever written!</p>
creates:
does the below paragraph's class correspond to "fantastic"?This is the best paragraph ever written!
<a href="#" onclick="alert(Element.hasClassName('test2', 'fantastic')); return false;">
does the below paragraph's class correspond to "fantastic"?</a>
<p id="test2" class="gross">This is a truly horrible piece of writting!</p>
creates:
does the below paragraph's class correspond to "fantastic"?This is a truly horrible piece of writting!