Get href attribute on jQuery

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

I have some table rows


    
        
      
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-12 14:04

    Use $(this) for get the desire element.

    function openAll()
    {
         $("tr.b_row").each(function(){
            var a_href = $(this).find('.cpt h2 a').attr('href');
            alert ("Href is: "+a_href);
         });
    }
    

提交回复
热议问题