how to get checking and unchecking checkbox count dynamically using javascript already i am restricting the user for max count of 20 items i want to show a message to user like ex: x of 20 items are selected
x i need count of checking/unchecking checkbox count

Ibrahim ErsoyRank #106 · 20.6K reputationPosted Mar 20, 2016, 11:37 PM EDT
script> var countChecked = function() { var n = $( "input:checked" ).length; $( "div" ).text( n + (n === 1 ? " is" : " are") + " checked!" ); }; countChecked(); $( "input[type=checkbox]" ).on( "click", countChecked ); script>