Skip to content

Instantly share code, notes, and snippets.

1
2
3
4
5
6
7
8
9
// assign elements that you want to be tabbable a data-tabbable ="true" property.
// If elements are hidden, they won't be considered.
keepFocus = function($el){
var tabbableEls = $el.parent().find($('[data-tabbable="true"]'));
$.each(tabbableEls, function(idx, el){
$(el).attr({'tabindex': 0});
});