I have to ask, how exactly do you expect this to work? To start, you call elements with the name of the check class that none of your elements have, then you just have an instruction without any task or something else ... You also create an array that just throws because split creates new array. Also, instead of your line splitting, just something like var temp = [1,3,5]; will work fine ... And finally you use for...in in the array, which is bad because arrays have properties next to their keys (e.g. length and several methods) ...
In any case, you need something more:
(function() { var elms = document.querySelectorAll('input[type=checkbox]'), l = qsa.length, i; for( i=0; i<l; i++) { elms[i].checked = (elms[i].value % 2 == 1); } })();
source share