开发者

jquery event - getting the context

if I have :

$('.someClass', $('#context1,#context1')).bind('click',
    function(e){
    /开发者_如何学编程/ XXX
    }
);

how can I know in point XXX , which context (context1 or context2) is the one that the .someClass element was clicked ?

Thanks, greetings


This should work

$(this).parents().filter("#context1,#context2")

Edit: My previous example had find instead of filter, I've fixed it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜