0

This works:

$('#Liste_EMPL input:checkbox').attr ('disabled', false);
$('#Liste_EMPL input:checkbox:checked').attr ('disabled', true);

It is very clumsy, as it requires two lines of code whereas I mean:

«Set disabled attribute to false for all checkboxes that are NOT checked.»

It should be something like this:

$("#Liste_EMPL input:checkbox [checked='false']").attr ('disabled', false);

I have tried many syntactic forms to no avail.

What is the correct syntax? (Please no loop including conditional statements).

1 Answer 1

1

Use :not

$("#Liste_EMPL input:checkbox:not(:checked)").attr('disabled', false);
Sign up to request clarification or add additional context in comments.

1 Comment

— that IS final. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.