views:

22

answers:

1

I can't for the life of me figure out the correct selector syntax to get this to work.

I have a div element. Using $(this), how would I select a <TD> that has a class="stock", but only within $(this) div element?

+4  A: 

Use find():

$(this).find('td.stock');

Or, alternatively, pass this as an context to the $() method:

$('td.stock', this);

Both do the same thing.

Tatu Ulmanen