1.0.3 • Published 5 years ago
show-password.js v1.0.3
show-password-js
A library to see what you have typed in a password field.
<script src="/path/to/show-password.js"><script>
<input type="password" show-input-password="1">
<span data-show-password="1">See</span>
The ID used in show-input-password
and data-show-password
need to match.
Configuration
If you want to override the configuration of show-password you need need to exclude it using your package manager.
To override the base configuration, all you need is to pass an object to ShowPasswordManager
constructor.
new ShowPasswordManager(configuration)
Key | Default value | Description |
---|---|---|
buttonSelector | "[data-show-password]" | The selector that will be used to search all the show buttons |
inputSelector | "[data-input-password]" | The selector that will be used to search all the password inputs |
If you use your own configuration, you still need to use attributes.
References
import ShowPasswordManager from 'show-password.js'
// default config
new ShowPasswordManager()
new ShowPasswordManager({ buttonSelector: '[input-selector]', inputSelector: '[input-selector]' })