<html>
<head>
</head>
<body>
<input type="Textbox" id="pwbx" />
<button OnClick="GetRandom()" type="button">generate</button>
<script>
function getCharacter() {
return Math.floor(Math.random() * 18).toString(18);
}
for( var str="", i=0, l=14+Math.floor(Math.random()*3); i<l; i++) {
str += getCharacter();
}
</script>
</body>
</html>
This gives me a random number under 1, like 0.4567432112 etc.
How would I alter this to give me a string of between 14 and 16 characters, random alphanumerical? So a string of either 14, 15 or 16 characters made up of abcdefgh0123456789?
Thanks