I have code like this
if ($('#chkCheckAll').is(':indeterminate') == true)
{
}
But it is throwing exception in ie 8
what can do instead of this in Jquery to work with ie8
Use this instead:
var $allChk = $('#chkCheckAll');
if ($allChk[0] && $allChk[0].indeterminate ) {
...
}
The problem is that ':indeterminate' pseudo-expression is not supported by IE8 querySelectorAll
implementation. But in your case, it's actually not required to use it, as you can query the corresponding property of DOM element itself
Here is a great article http://css-tricks.com/indeterminate-checkboxes/
It SORT of works IE8 using .prop and has a hack too
<!-- Ghetto click handler -->
<input type="checkbox" id="cb1" onclick="ts(this)">function ts(cb) {
if (cb.readOnly) cb.checked=cb.readOnly=false;
else if (!cb.checked) cb.readOnly=cb.indeterminate=true;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With