I have a dropdown of users with different permissions. The different permissions for the users are view, edit or delete. When choosing the user from the dropdown, the checkboxes should update according to which permissions they have. I've tried using .prop() and .attr() to no avail. http://jsfiddle.net/DWM4r/
HTML
<select class='select210'>
<option class='user1'>wjazi@deloitte.com</option>
<option class='user2'>aschwem@company.com</option>
<option class='user3'>tcooksnow@usa.com</option>
</select>
<input type='checkbox' checked class='viewChk' />View
<input type='checkbox' checked class='editChk' />Edit
<input type='checkbox' checked class='delChk' />Delete
jQuery
$('.user3').click(function() {
$('.viewChk').attr('checked', true);
$('.editChk').attr('checked', false);
$('.delChk').attr('checked', false);
});
$('.user2').click(function() {
$('.viewChk').prop('checked', true);
$('.editChk').prop('checked', true);
$('.delChk').prop('checked', false);
});
$('.user1').click(function() {
$('.viewChk').prop('checked', true);
$('.editChk').prop('checked', true);
$('.delChk').prop('checked', true);
});