How to get ID of clicked element with jQuery

后端 未结 5 1966
花落未央
花落未央 2020-12-08 18:38

I have the following html:

link
link         


        
5条回答
  •  暖寄归人
    2020-12-08 19:24

    You just need to remove the hash from the beginning:

    $('a.pagerlink').click(function() { 
        var id = $(this).attr('id').substring(1);
        $container.cycle(id); 
        return false; 
    }); 
    

提交回复
热议问题