How to target the href to div

前端 未结 7 2030
不知归路
不知归路 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:37

    havent tried but this might help

    $(document).ready(function(){
    r=0;s=-1;
    $(a).click(function(){
    v=$(this).html();
    $(a).each(function(){
    if($(this).html()==v)
    return;
    else ++r;
    $(div).each(function(){
    if(s==r)
    $(div).appendTo($(".target")); 
    ++S;
    });
    
    });
    
    });
    

    });

提交回复
热议问题