Help me complete this JS pwgen please? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help me complete this JS pwgen please?

I've written a secure password generator that works a lot like the pwgen linux command. I use that all the time when registering on new sites, I thought it'd be a great saturday project to do a web version. It's nothing new but everything I saw only generates one word at a time, which IMO is less secure than generating hundreds of em. https://code.sololearn.com/Wih1C7hIskXl Its coming out fine but there's two features I want and couldn't get working: * Call the generate function automatically when document is ready (errors out on null value) * Trigger select and copy to clipboard when clicking/touching one of the words (td cell).

16th Dec 2017, 6:58 PM
Simon
Simon - avatar
2 Answers
+ 5
You can add this at the top of your JS for the first point: window.onload = function(){ generate(); } And then change line 32 to this: let len = $("#length").val();
17th Dec 2017, 10:46 PM
Duncan
Duncan - avatar
+ 1
Here's v2.0, I'm pretty pleased with that :-) https://code.sololearn.com/Wcto4XznU3sp
21st Dec 2017, 2:49 AM
Simon
Simon - avatar