Note that this isn’t quite right anyway; is()
is a jQuery method, not a CSS selector.
Just for the sake of completeness, if you’re going with that approach, then inside the each()
loop you need to also check the current element (i.e. this
), not just any .sampleTest
element:
$('.sampleTest').each(function () {
var $this = $(this)
if (
$this.is('[data-test-not-available="true"]') &&
$this.is('[data-read-only="false"]') &&
$this.is(':checked') &&
) {
$this.removeAttr('disabled')
}
})