Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (65 sloc) 1.53 KB
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
<title>JavaScript Random String Generator</title>
body {
font: 12px Arial, sans-serif;
color: #333;
.info {
margin-bottom: 24px;
<h1>Random String Generator</h1>
<p class="info">The following strings are generated to a random length using a max limit of 30 characters.</p>
<section class="block">
<h2>Numeric String</h2>
<p id="str_numeric"></p>
<section class="block">
<h2>Alphabetic String - Lowercase</h2>
<p id="str_alphalc"></p>
<section class="block">
<h2>Alphabetic String - Uppercase</h2>
<p id="str_alphauc"></p>
<section class="block">
<h2>Alphabetic String</h2>
<p id="str_alpha"></p>
<section class="block">
<h2>Alphanumeric String</h2>
<p id="str_alphanum"></p>
<section class="block">
<h2>Special Characters</h2>
<p id="str_special"></p>
<section class="block">
<h2>All Characters</h2>
<p id="str_all"></p>
<script src="random_string_generator.js"></script>
window.onload = function(){
var els = {
'str_numeric' : 'num',
'str_alphalc' : 'alphalc',
'str_alphauc' : 'alphauc',
'str_alpha' : 'alpha',
'str_alphanum': 'alphanum',
'str_special' : 'special',
'str_all' : 'all'
for (var prop in els){
document.getElementById(prop).appendChild( document.createTextNode(generateRandomString(els[prop], 30)) );