Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tab_trap

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tab_trap

Overwrite the browsers default behaviour when pressing tab. While navigating through a form using the tab key the focus will not be set outside of the form ( e.g. the browsers url bar ).

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

tab_trap

A jQuery plugin to overwrite the browsers default behaviour when pressing tab. While navigating through a form using the tab key the focus will not be set outside of the form ( e.g. the browsers url bar ).

Installation

Run npm install tab_trap from the root directory of your application.

Include jQuery on your page if you don't already have it.

<script type="text/javascript" src="node_modules/jquery/dist/jquery.min.js"></script>

Include the plugin.

<script type="text/javascript" src="node_modules/tab_trap/jquery.tab_trap.js"></script>

Usage Examples

Simply call the plugins main function on the element(s) you want it applied to.

Apply to all form elements:

$( "form" ).trapTabs();

Apply to a specific element:

$( "#myForm" ).trapTabs();

In case you still want to do something with the keydown event of the Tab key there is the onTab callback option:

$( "form" ).trapTabs( {
  onTab: function() { console.log( "Tabbing out of: " + $( this ).attr( "id" ) ); }
} );

Keywords

FAQs

Package last updated on 25 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc