GithubHelp home page GithubHelp logo

concept211 / toggle-password Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 11 KB

jQuery Toggle Password Plugin is a lightweight jQuery plugin that allows users to toggle the visibility of password fields in web forms with a single click.

JavaScript 75.61% CSS 24.39%

toggle-password's Introduction

jQuery Toggle Password Plugin ๐Ÿ‘

jQuery Toggle Password Plugin is a lightweight jQuery plugin that allows users to toggle the visibility of password fields in web forms with a single click.

Features

  • Easily toggle password visibility for password input fields.
  • Customizable icons for show/hide states.
  • Simple integration into existing web forms.

Include directly in HTML

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="toggle-password.js"></script>
<link rel="stylesheet" href="toggle-password.css">

Usage

  1. Add the necessary HTML for your password input fields and include Font Awesome for icons (if not already included):
<input type="password" class="toggle-password" id="password" placeholder="Password">
  1. Call the plugin on the password input fields:
$('.toggle-password').togglePassword({
    show: 'fa-eye',
    hide: 'fa-eye-slash',
    base: 'fa fa-fw toggle-password-button'
});

Options

The plugin supports the following options:

  • show (string): The Font Awesome class for the icon to show the password (default: 'fa-eye').
  • hide (string): The Font Awesome class for the icon to hide the password (default: 'fa-eye-slash').
  • base (string): Additional classes for the toggle button (default: 'fa fa-fw toggle-password-button').

Contributing

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please feel free to open an issue or create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

toggle-password's People

Contributors

concept211 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.