Bootstrap Show Password plugin
![]() |
github here
step1:
link font-awesome.css(or you can just use Bootstrap's Glyphicon font )
link jquery library, bootstrap-show-password.js
step2:
html
![]() |
html |
Name | Attribute | type | default | description |
---|---|---|---|---|
- | data-toggle | String | password | Active password without writing JavaScript. |
placement | data-placement | String | after | The placement of show/hide icon, can be 'before' or 'after'. |
message | data-message | String | Click here to show/hide password | The tooltip of show/hide icon. |
white | data-white | Boolean | false | Show the white icon. (Just work in bootstrap v2) |
eyeClass | data-eye-class | String | glyphicon | Base eye icon class. |
eyeOpenClass | data-eye-open-class | String | glyphicon-eye-open | Open eye icon class. |
eyeCloseClass | data-eye-close-class | String | glyphicon-eye-close | Close eye icon class. |
eyeClassPositionInside | data-eye-class-position-inside | Boolean | false | Puts the open/close class inside the <i>. Use this option with google material icons. |
css
![]() |
css |
js
![]() |
js |
the #password2 with event show.bs.password. When the password shows,the event fires.
Event Type | Description |
---|---|
show.bs.password | This event fires immediately when the show instance method is called. If caused by a click, the clicked element is available as the relatedTarget property of the event. |
hide.bs.password | This event is fired immediately when the hide instance method has been called. |
$('#password').on('show.bs.password', function (e) {
// code here
});