开发者

How to get the tbody element of a table using JQuery?

开发者 https://www.devze.com 2023-03-21 12:10 出处:网络
I have a table structure (Table1) with thead and tbody. My main thead also has a table inside wit开发者_运维百科h its own thead and tbody.

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

My main thead also has a table inside wit开发者_运维百科h 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,


 $('#Table1 > tbody')

> will get direct children.


Alternative:

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


simple add table id and get the value example

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

精彩评论

暂无评论...
验证码 换一张
取 消