Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery if each checkbox is checked push array using each site:stackoverflow.com

var favorite = {};
$.each($(".list input[type='checkbox']:checked"), function(){ 
    if(typeof(favorite[$(this).attr("name")]) == 'undefined'){
        favorite[$(this).attr("name")] = [];
    }           
    favorite[$(this).attr("name")].push($(this).val());
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #checkbox #checked #push #array
ADD COMMENT
Topic
Name
6+8 =