<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<div style='background:red;width:200px;height:50px' onclick='a()'>
    <input type='button' value='ok' onclick='b(event)'></input>
</div>
<script type="text/javascript">
     function a(e){
        console.log("div")
    }
    function b(e){
        console.log(e);
        if(e&&e.stopPropagation){
            e.stopPropagation();
        }else{
            window.event.cancelBubble =true;
        }
     }
</script>
</body>
</html>

 

 

 

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2021-05-25
猜你喜欢
  • 2021-07-14
  • 2022-03-05
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案