Using jQuery/Javascript, how do I find the maximum tabindex
value that exists on a given form #formID
?
And before you ask (because I know people will) I haven't tried anything because I really have no idea where to begin.
This is one way:
var max = -1;
$('#formID [tabindex]').attr('tabindex', function (a, b) {
max = Math.max(max, +b);
});
max = -1
indicates, that there's no tabindexes in the form, or elements are excluded from tabbing order.
A live demo at jsFiddle.
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