41

I have a table structure (Table1) with thead and tbody.

My main thead also has a table inside with its own thead and tbody.

When I use $('#Table1 tbody') it returns all tbody elements whereas I'd only need the tbody of the Table1.

How could this be achieved?

Thanks,

3 Answers 3

81
 $('#Table1 > tbody') 

> will get direct children.

Sign up to request clarification or add additional context in comments.

1 Comment

Note the quotes are outside the whole expression, and not around each element selector, as it can be seen elsewhere. Saved my day, thx !
30

Alternative:

 $('#Table1').children('tbody') 

Comments

0

simple add table id and get the value example

 $('#dc-table tbody').on('keyup','.qty_approved', function(){ alert('tested...'); }); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.