<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<script>
function init() {
function fn(el) {
return el.value
}
var arr = Array.prototype.map.call(document.querySelectorAll("input:checked"), fn)
alert(arr)
}
window.onload = init;
</script>
</head>
<body>
<input type="checkbox" value="1">
<input type="checkbox" value="2">
<input type="checkbox" value="3" checked="checked">
<input type="checkbox" value="4">
<input type="checkbox" value="5" checked="checked">
</body>
</html>