how can i get the text inside an anchor tag in jquery

前端 未结 2 738
醉话见心
醉话见心 2021-01-13 21:13


//jquery
$(\"#div1 a\").click(function(){
var text = $(         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 21:20

    Use this :

      $("#div1 a").click(function(){
        var text = $(this).text();
      });
    

提交回复
热议问题