I am working on the following code. Why am I not able to update the chekbox states based on selected array?
var selected = [134,135,136,137,138,139,140,141,142,143,144];
$.each(selected, function(index, value){
$("input[type='checkbox'][value"+ value.member_key+ "]").prop("checked", true);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="checkbox" name="vehicle" value="133">133<br>
<input type="checkbox" name="vehicle" value="134">134<br>
<input type="checkbox" name="vehicle" value="135">135<br>
<input type="checkbox" name="vehicle" value="136">136<br>
<input type="checkbox" name="vehicle" value="137">137<br>
<input type="checkbox" name="vehicle" value="138">138<br>
<input type="checkbox" name="vehicle" value="139">139<br>
<input type="checkbox" name="vehicle" value="140">140<br>
<input type="checkbox" name="vehicle" value="141">141<br>
<input type="checkbox" name="vehicle" value="142">142<br>
<input type="checkbox" name="vehicle" value="143">143<br>
<input type="checkbox" name="vehicle" value="144">144<br>
<input type="checkbox" name="vehicle" value="145">145<br>
<input type="checkbox" name="vehicle" value="146">146<br>
value.member_key. Your value is going to be just each number in the array... Edit: also you are missing the=on your value selector matcher