2012-07-04 36 views

回答

1
var arr = $.map($('input[type="checkbox"]:checked'),function(checkbox){ 
        return checkbox.value; 
       }) 
1

你可以试试这个:

function updateTextArea() {   
    var allVals = []; 
    $('#c_b :checked').each(function() { 
     allVals.push($(this).val()); 
    }); 
    $('#t').val(allVals) 
    } 
$(function() { 
    $('#c_b input').click(updateTextArea); 
    updateTextArea(); 
}); 
相关问题