Security Password Generator With JavaScript

Category: Form , Javascript | December 19, 2017
Views Total:719 views
Official Page:Go to website
Last Update:December 19, 2017


Security Password Generator With JavaScript


Just another pure JavaScript plugin used for generating strong random password strings with just one click.

How to use it:

The html for the password generator.

<label for="blocks-length">Blocks length
  <input type="number" min="1" max="10" value="4" id="blocks-length">
<label for="blocks">Number of blocks
  <input type="number" min="1" max="10" value="4" id="blocks">
<label for="blocks-separator">Blocks separator
  <input type="text" id="blocks-separator" value="-">
<button type="button" id="generate-passwd">Suggest Password</button>

Create an element to display the generated password.

<output id="wrapper"></output>

Include the main JavaScript on the web page when needed.

<script src="generate-passwd.js"></script>

The JavaScript to activate the password generator.

function testGeneratePasswd() {
var wrapper = document.getElementById('wrapper'),
  blocksLength = document.getElementById('blocks-length').value,
  blocksNumber = document.getElementById('blocks').value,
  blocksSeparator = document.getElementById('blocks-separator').value,
  passwd = generatePasswd({
    blocksLength: blocksLength,
    blocksNumber: blocksNumber,
    blocksSeparator: blocksSeparator
wrapper.innerHTML = passwd;
document.getElementById('generate-passwd').addEventListener('click', function() {

You Might Be Interested In:

Leave a Reply