单击嵌套跨度时禁用父按钮的单击效果

问题描述 投票:0回答:1
javascript jquery jsf
1个回答
0
投票
` 常量按钮 = $('#myButton'); const span = $('#spanQuestion');
span.on("click", function (e) {
    e.stopPropagation();
});

button.on("click", function (e) {
    // Your button click logic here
});

`

© www.soinside.com 2019 - 2024. All rights reserved.