How to get values from fileds which have same class name in jquery?

The way to do it is as follows:

var cpt= new Array();
$('.cpt_code').each(function() {
   console.log( $(this).val() );
   //alert($(this).val());
   cpt[x]=$(this).val();
   x++;
})

Leave a Reply