Get href attribute on jQuery

后端 未结 6 1413
眼角桃花
眼角桃花 2021-02-12 13:24

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

提交回复
热议问题