I have some table rows
6条回答 难免孤独 (楼主) 2021-02-12 13:57 Very simply, use this as the context: http://api.jquery.com/jQuery/#selector-context var a_href = $('div.cpt', this).find('h2 a').attr('href'); Which says, find 'div.cpt' only inside this 0 讨论(0) 查看其它6个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
Very simply, use this as the context: http://api.jquery.com/jQuery/#selector-context
this
var a_href = $('div.cpt', this).find('h2 a').attr('href');
Which says, find 'div.cpt' only inside this
'div.cpt'