How to target the href to div

前端 未结 7 2032
不知归路
不知归路 2020-12-14 02:58

Here i am trying to open and get the contents of one div to target div on-click on a href. Here i have table where i have hrefs which has the link to div ids, and i have an

相关标签:
7条回答
  • 2020-12-14 03:51

    Try this code in jquery

    $(document).ready(function(){
      $("a").click(function(){
      var id=$(this).attr('href');
      var value=$(id).text();
      $(".target").text(value);
      });
    });
    
    0 讨论(0)
提交回复
热议问题