<html>
<head>
<meta charset="utf-8">
</head>
<body>
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<script>
show=function(){alert(1)}
;[].forEach.call(document.querySelectorAll('input[type=checkbox]'), function(box){box.onchange=show})
</script>
</body>
</html>