pwd-js is a jQuery plugin that helps to generate a safe password
$ npm i random-pwd-generator
or
$ yarn add random-pwd-generator
// 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">
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>