tabable
v1.0.0
Published
A simple module to set tab indices on elements.
Downloads
58
Readme
Tabable
This is a simple module that will add tab-index attributes to your elements.
Install
$ npm install tabable
Usage
tabable( element[, filter ] )
Given an element, tabable find all the inputs (or whatever you specify via the optional filter argument) within it an give them a tab-index. Eg:
var tabable = require( 'tabable' );
// make all the inputs have a reasonable tab-index
tabable( document.getElementById( 'foo' ) );
Only want textareas to be tabable?
var tabable = require( 'tabable' );
// only set tab-index on the textarea elements
tabable( document.getElementById( 'foo' ), 'textarea' );