 <p>Your selectors are incorrect, you're using the hash to indicate and <strong>id</strong>. Also you're prefixing your classes with an element notation that is not correct.</p> <p>This </p> <pre><code>if($('#tr').hasClass('tr_group')) </code></pre> <p>should be:</p> <pre><code>if($('tr').hasClass('group')) </code></pre>