Select current element in jQuery

前端 未结 5 828
无人共我
无人共我 2020-12-08 00:30

I have HTML code like this :



         


        
5条回答
  •  暖寄归人
    2020-12-08 01:03

    Fortunately, jQuery selectors allow you much more freedom:

    $("div a").click( function(event)
    {
       var clicked = $(this); // jQuery wrapper for clicked element
       // ... click-specific code goes here ...
    });
    

    ...will attach the specified callback to each contained in a

提交回复
热议问题