Simple jQuery Plugin To Show Hidden Password - preventPassTypo

File Size: 3.78KB
Views Total: 1770
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Simple jQuery Plugin To Show Hidden Password - preventPassTypo

preventPassTypo is a super simple jQuery plugin for showing hidden password user input by pressing a custom shortcut key or clicking a checkbox.

How to use it:

1. Include jQuery library and jQuery preventPassTypo on your web page

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>

2. Markup

Password: <input type="password" id="password" name="password" /> 
Show Password: <input type="checkbox" id="showpass" name="showpass" />

3. Initialize the plugin. Only When Pressed KeyChar 17 (CTRL)

<script type='text/javascript'>
$(window).load(function(){
$("#password").preventPassTypo(17); //Only When Pressed KeyChar 17 (CTRL)
}); 
</script>

4. Initialize the plugin. Or when checkbox #showpass is checked

<script type='text/javascript'>
$(window).load(function(){
$("#showpass").preventPassTypoOn("#password"); //and when checkbox #showpass is checked
}); 
</script>

This awesome jQuery plugin is developed by unknown. For more Advanced Usages, please check the demo page or visit the official website.