tags:

views:

20

answers:

1

I've got:

<th>First Name<span class="ui-icon ui-icon-arrowthick-1-s"></span></th>

When the user clicks on a th cell, I need to clear the span tag from every one of it's siblings.

$('th').click(function() {
var $th = $(this);
$th.siblings().each
+1  A: 

Your question isn't very clear -- your title says remove the class, but your post says you need to clear the span tag? To remove the class you would use removeClass() in your each block. Otherwise to remove the entire tag you could use remove().

Edit You could try this:

$('th').click(function() {
  var $th = $(this);
  $th.siblings().each(function() {
    $('span').remove();
  }
}
Calvin L
Calvin, thanks for answering my poorly worded question.
cf_PhillipSenn
You missed a closing ) for the each method.
cf_PhillipSenn
You're welcome. By the way, I believe you could also do something like this, without having to use the `each` function: `$th.siblings().remove('span');`. Not sure, but give it a try.
Calvin L