# I want to retrieve the values of checkboxes using jQuery

How to use jQuery to get the values of the checked checkboxes, and i also ant to put it into a textarea immediately?

The following code will solve the problem for you

function writeInTextArea() {

var checkBoxVals = [];

$('#c_b :checked').each(function() { checkBoxVals.push($(this).val());

});

$('#t').val(checkBoxVals); }$(function() {

\$('#c_b input').click(writeInTextArea);

writeInTextArea();

});