<!DOCTYPE HTML>
<html>
<head></head>
<body>
<input type="checkbox" name="thirdStep" id="cb1" /> ch1 <br />
<input type="checkbox" name="thirdStep" id="cb2" /> ch2 <br />
<input type="checkbox" name="thirdStep" id="cb3" /> ch3 <br />
<input type="checkbox" name="thirdStep" id="cb4" /> ch4 <br />
<div id="cost">0</div>
<script>
var elems = document.querySelectorAll('[id^="cb"]'),
cost = document.getElementById('cost');
for(var i=0; i<elems.length; i++) elems[i].onchange = function() {
cost.innerHTML = +cost.innerHTML + (+this.checked || -1); /*(this.checked ? 1 : -1)*/
}
</script>
</body>
</html>