Reputation: 596
This if block:
count = 1;
if (count == 4) {
alert(count);
$(":checkbox").attr("disabled", true);
count = 0;
}
is not running. I have also added an alert() but its not appearing. My javascript code also contains some jQuery. How to solve it?
Upvotes: 1
Views: 110
Reputation: 129802
In your current code, you're always setting count
to 1
before checking whether it is 4
. It will never be 4
, it will always be 1
.
Upvotes: 5
Reputation: 237080
Based on this information, it would appear that count
is not 4. If you want this block to run anyway, get rid of the whole if(){}
around it.
Upvotes: 1