I am trying to do a select all in jQuery to all those who contain a specific class. However, I want one of those elements that has the class to not be selected if it has a specific data-id, in this case data-id='162'.
This code works to check all of them, but what can I do here to not check the one that has data-id:162?
$('.elementsToCheck').attr('checked', checked)