views:

22

answers:

1
<input type="checkbox" id="var1" name="s_k" >
<input type="checkbox" id="var2" name="s_k">
<input type="checkbox" id="var3" name="s_k">

At some point the checkbox id=var1 is selected and disabled after a certain operation.Now then if id var2 and var3 checkbox are selected how to get the newly selected box id i.e, get ids of checkboxes which is not disabled using jquery

+2  A: 

i.e, get ids of checkboxes which is not disabled using jquery

I'm assuming your question is "how can I do that thing I just said?", in which case, you can combine the :not and :disabled selectors:

// Get all checkboxes that aren't disabled:
$('input[type="checkbox"]:not(:disabled)')

// Get all selected checkboxes that aren't disabled:
$('input[type="checkbox"]:checked:not(:disabled)')
Andy E