random-pwd-generator
v1.0.0
Published
pwd-js is a jQuery plugin that helps to generate a safe password
Downloads
9
Maintainers
Readme
Random Password generator
pwd-js is a jQuery plugin that helps to generate a safe password
Documentation
Usage
Include the relevant files
// jQuery dependency
<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
// Then add pwd-js
<script src="src/pwd-js.js">
Create an HTML element
for this demo we have create an input
<input id="txtpassword" type="text">
<script type="text/javascript">
//select a random button element
let btn = document.querySelector('div .card-body a.btn')
btn.addEventListener('click', function() {
//apply the generate method to get a random password
document.querySelector('#txtpassword').value = pwdjs.generate()
})
</script>