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(); })