This page uses the very latest official version of jQuery. removeClass should now work correctly.

The alert should only show one class set on the block at a time. Click the block to change its class.

The javascript gets its current class attribute with currentClass=block.getAttribute("class"); then does $(block).removeClass(currentClass).addClass(nextClass); to change classes.


Go to the identical test page using the older version of jQuery