2014年12月9日 星期二

JavaScript count checkbox checked

alert(document.querySelectorAll('input[type="checkbox"]:checked').length);

alert(document.querySelectorAll('input[name="selectItem[]"]:checked').length);




References :
javascript - Count the number of checked checkboxes in html - Stack Overflow

沒有留言:

張貼留言