Temukan panjang check -in js

var checkbox = document.getElementsByName('ckbox[]');
var ln = 0;
for(var i=0; i< checkbox.length; i++) {
    if(checkbox[i].checked)
        ln++
}
alert(ln)
Noob Learner