gpt4 book ai didi

javascript - jquery - 谁是我的 parent 听众?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:52:16 26 4
gpt4 key购买 nike

$(".cblClaimSources").on('click', ':checkbox', function (){
alert('im : '+ $(this).attr('id') + ' and my Parent listener is '+ ?????);
});

insider $(this) 是否有可能知道谁是它的监听器父级? [$(".cblClaimSources")] ?

最佳答案

如果使用 jQuery 1.7:

$(".cblClaimSources").on('click', ':checkbox', function (e) {
var parentListener = e.delegateTarget;
});

http://jsfiddle.net/mHXMq/3/

关于javascript - jquery - 谁是我的 parent 听众?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10311574/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com