<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
function getAllSelectedId() {
var a = document.querySelectorAll(":checked");
alert([].map.call(a, function(a) {
return a.id
}))
};
</script>
</head>
<body>
<div id="work_div">
<input type="checkbox" class="checkbox" id="1" checked="checked"/>
<input type="checkbox" class="checkbox" id="2"/>
<input type="checkbox" class="checkbox" id="3" checked="checked"/>
<input type="checkbox" class="checkbox" id="4"/>
<input type="checkbox" class="checkbox" id="5"/>
<br>
<input type="button" id="checkbox_get" value="Получить id выбранных" onclick="getAllSelectedId()"/>
</div>
</body>
</html>