Issue
I am trying to select all the elements which has tabindex greater than -1 (focus-able elements). So far this is what I came up with:
$element.find('[tabindex]:not([tabindex < \'0\'])');
It does not work but instead throws an error:
Error: Syntax error, unrecognized expression: [tabindex < '0']
at Function.Sizzle.error (vendor.js:1463)
...
This, however, works but itdoes not cover cases where tabindex < -1.
$element.find('[tabindex]:not([tabindex=\'-1\'])');
Solution
Selectors doesn't provide attribute selectors with numeric comparisons, and neither does jQuery.
In this specific case, I suppose you could just exclude elements with a tabindex starting with the -
sign (in addition to excluding elements with a tabindex of 0):
$element.find('[tabindex]:not([tabindex="0"]):not([tabindex^="-"])');
Answered By - BoltClock
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.