题解 | #阻止冒泡事件#
阻止冒泡事件
http://www.nowcoder.com/practice/1c12ccea98b049078d2cd3ef39269856
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<ul>
<li>nowcoder</li>
</ul>
</body>
</html>
var li = document.querySelector("li");
li.addEventListener('click', function(e){
e.stopPropagation();
})