This quick tip is for fixing conflicts with tabindex, which often occur when you’re using a content management system that has modules.
If the modules don’t play nice together, index-wise, use this js / jQuery function.
1 2 3 |
function fixTabIndex() { $("a[href], input, textarea, select").each(function (i) { $(this).attr('tabindex', i + 1); }); } |
Just make sure to call it in the document ready part.
1 2 3 |
$( document ).ready(function() { fixTabIndex(); } |
This function runs on all the input and link elements in the page, and by the order they were found on the page, sets the new tabindex.