FrenkyB FrenkyB - 6 days ago 5
Javascript Question

HTML search by two properties

I would like to be able to search for checkboxes which are not disabled (attribute

is not set to

My function is below. I am able to find all checkboxes, but I don't know how to search for not-disabled checkboxes:

MarkAllColumns = function () {

if (MarkAll === true) {
$("#tblArticlesSearch input[type=checkbox]").prop('checked', true);
else {
$("#tblArticlesSearch input[type=checkbox]").prop('checked', false);


I want to set attribute
to true only on not-disabled checkboxes.


You can either use :enabled selector or combine :not with :disabled selector

$("#tblArticlesSearch input[type=checkbox]:enabled")


$("#tblArticlesSearch input[type=checkbox]:not(:disabled)")