 <pre><code>$("#myButton").click( function() { var class = $(this).attr("class"); }); </code></pre> <p>Note that this can potentially contain multiple classes though.</p> <p>If you need to check if a specific class exists in the CSS class list:</p> <pre><code>$("#myButton").click( function() { var isHighlighted = $(this).hasClass("highlight"); }); </code></pre> <p>There's also addClass() and removeClass(). Generally there should be very little reason to ever retrieve the full class attribute as a string - it's much easier to manipulate or compare the attribute by using the jQuery methods instead.</p>