How to retrieve checkboxes values in jQuery
How to use jQuery to get the checked checkboxes values, and put it into a textarea immediately?
Just like this code:
Here's one that works.
function updateTextArea() { var allVals = []; $('#divId :checked').each(function() { allVals.push($(this).val()); }); $('#t').val(allVals); } $(function() { $('#divId input').click(updateTextArea); updateTextArea(); });
How to retrieve checkboxes values in jQuery
Reviewed by Ashok Sen
on
19:49:00
Rating:
No comments:
Post a Comment