all im tryin to do is get the values of all checkboxes in child elements, i have seen this question: How to retrieve checkboxes values in jQuery but cant successfully get it working on child elements
My code is this:
<ul id="menu3" class="side_menu expandfirst noaccordion">
<li>
<div class="refine_att"><a href="#" name="Expand/Collapse">Price</a></div>
<ul class="check">
<li><input onclick="updateTextArea()" id="_1" type="checkbox"><a href="#"> £0.00 - £9.99 </a></li>
<li><input onclick="updateTextArea()" id="_2" type="checkbox"><a href="#"> £10.00 - £99.99 </a></li>
<li><input onclick="updateTextArea()" id="_3" type="checkbox"><a href="#"> £100.00 - £249.99 </a></li>
<li><input onclick="updateTextArea()" id="_4" type="checkbox"><a href="#"> £250.00 - £499.99 </a></li>
<li><input onclick="updateTextArea()" id="_5" type="checkbox"><a href="#"> £500.00 - £999.99 </a></li>
</ul>
</div>
</li>
</ul>
There could also be multiple 'refine_att' lists, ive shown just one here
function updateTextArea() {
var allVals = [];
$('#menu3').find(":checked").each(function() {
allVals.push($(this).val());
});
$('#t').val(allVals)
}