题解 | #阻止默认事件#
阻止默认事件
http://www.nowcoder.com/practice/34c11cb34e0e40df9c196de99a7b2a26
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<form>
<label>牛客会陪伴大家</label>
<input id="checkbox" type="checkbox" checked />
</form>
</body>
</html>
let input = document.querySelector('input');
input.addEventListener('click', function(e) {
e.preventDefault();
})