Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

multiple checkbox jquery

//This are the list of checkbox(2 selected, 2 unselected)
<input name="numchec"  type="checkbox" value="1" checked/>
  <input name="numchec"  type="checkbox" value="2" />
  <input name="numchec"  type="checkbox" value="3" checked/>
  <input name="numchec"  type="checkbox" value="4" />
  
 //Jquery Code
 
 $(document).ready(function(){
     var data=$('input[name=numchec]:checked').map(function(err, el) {
      			return $(el).val();
  			}).get();
     alert(data)
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiple #checkbox #jquery
ADD COMMENT
Topic
Name
1+8 =