我项目中需要实现的效果大致如下图所示:

jq实现点击div任意地方触发保存事件,但是触发div里的其他标签不触发保存事件

 大致实现的思路如下:

// 点击任意地方实现保存
$('.policyWhiteShow input').bind("click",function(event){
    event=event||window.event;
    console.log('点击input!!!!!');
    event.stopPropagation();
})
$('.policyWhiteShow label').bind("click",function(event){
    event=event||window.event;
    console.log('点击label!!!!!');
    event.stopPropagation();
})
$('.policyWhiteShow').bind("click",function(event){
    event=event||window.event;
    console.log('保存成功!!!!!');
    event.stopPropagation();
})

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-08-09
  • 2021-11-30
  • 2021-06-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-11-20
  • 2021-08-11
  • 2021-08-18
相关资源
相似解决方案