title: jquery different selectors that should act the same have different behaviours
body: <p>I have a function that when a td is clicked it finds the th that is directly above it and changes it's width</p>
  
  <p>before I did not have a class for my td and th so I was using this selector </p>
  
  <pre><code>var selectedTh = $this.closest('table').find('th').eq($this.index());
  </code></pre>
  
  <p>and it worked perfectly and changed the width as it should.</p>
  
  <p>Now I want to refactor it, so I have a class for the td and th (specific class for each column) - I tried using this selector  </p>
  
  <pre><code>var selectedTh = $('th',$(this).attr('class'));
  </code></pre>
  
  <p>and when I am debugging it, I am pretty sure it is selecting the th I want
  but after when I do </p>
  
  <pre><code> var tableWidth = $('table').width();
                  var colWidth = tableWidth / $('th', $table).length;
                  selectedTh.addClass("fullWidth");
                  selectedTh.animate({
                      width: colWidth + 100
                      }, 150);
  </code></pre>
  
  <p>it does nothing </p>
  
  <p>Just to clarify the class I am looking for it by is not the fullwidth that I am adding it is a class that was set before and exists there.</p>
  
  <p>When I was using the previous selector it was changing it correctly </p>
  
  <p>Any idea how I can use the selector to choose the correct th element by class?</p>