🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

ls-capslock is a JavaScript (jQuery) plugin that displays a custom warning message when the user types Caps Lock in an input field (typically a password input).

Password

Documentation

LS CAPSLOCK

Simple JS library to show an notification that the caps lock is pressed. Useful for password inputs.

How to install?

bower install ls-capslock --save

then just put the ls-capslock.js and ls-capslock.css into your page.

How to use?

/*      Setup the elments actions and properties.          Usage: ls_capslock.init(options);      Possibles arguments:         options = {             element, [string element id, string element class, HTMLInputElement, HTMLCollection, Array of HTMLInputElement] [REQUIRED]             message, [string] [OPTIONAL] [DEFAULT 'Caps Lock is pressed!']             customClasses, [Array of string] [OPTIONAL] [DEFAULT NULL]             position [string (top, bottom, left, right)] [OPTIONAL] [DEFAULT 'bottom']         } */ ls_capslock.init({     element: '#sample-capslock-input',     message: 'If you are seen this message, your caps lock is activated!',     customClasses: ['customClass1', 'customClass2'],     position: 'bottom' });

See live demo here!

Contribute

Any sugestion or bug report, just open a PR on develop branch or mail me at [email protected]


You May Also Like