Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="id_check_request_page" style="width: 1000px; margin: 0px auto 0px auto;" class="clear">
					<div class="floatleft" style="width: 998px;">
						<p class="toolheading" style="margin-top: 10px;">
							Random Password Generator
						</p>
						<p class="runningtxt">
							Create a strong random password. Include numbers, alphabets(Lower case and upper case) and special characters to generate a strong password.
						</p>
					</div>
					<div class="clear"></div>
					<form name="passform" siq_id="autopick_1486">
						<div>
							<div class="floatleft">
								<input type="text" class="websitename floatleft" style="padding-left: 8px;" name="password" size="30" id="password" value="Your password will be shown here">
							</div>
							<div class="copypass floatleft">
								<span style="color: #1E90FF;" id="message"></span>
							</div>
						</div>
						<div class="clear"></div>
						<div id="configdiv" style="border:1px solid transparent;">
							<div>&nbsp;</div>
							<div>
								<span class="toolstext">Password Rules</span>
							</div>
							<div class="labelname floatleft marright">
								Password length
							</div>
							<div>
								<input type="text" class="passlength" name="passwordLength" value="10" size="3">
							</div>
							<div class="clear"></div>
							<div class="labelname floatleft marright">
								<input type="checkbox" name="uppercase" checked=""> A-Z 
							</div>
							<div class="labelname floatleft marright">
								<input type="checkbox" class="passcheckbox" name="lowercase" checked=""> a-z
							</div>
							<div class="labelname floatleft marright">
								<input type="checkbox" name="numbers" checked=""> 0-9
							</div>
							<div class="labelname">
								<input type="checkbox" name="avoidAmbiguous" checked=""> 
								Avoid Ambiguous Characters(1,I,l,o,O,0)
							</div>
							<div class="labelname marright">
								<input type="checkbox" id="defaultspecialchars" name="specialchars">
								Use Special Characters
							</div>
						</div>
						<div>
							<input class="grnbutton" type="button" value="Regenerate Password" onclick="generatePassword()">
						</div>
					</form>
				</div>
              
            
!

CSS

              
                
.marright {
        margin-right:16px;
}
.passcheckbox {
	position : relative;
	top : 0;
	margin-top : 0;
}
.passradio {
	position:relative; 
	top:0px; 
	margin-top:0px;
	margin-right:5px
}
.passlength {
   -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #fff;
    border-color: #cccccc;
    border-image: none;
    border-style: solid solid solid solid;
    border-width: 1px 1px 1px 1px;
    color: #888;
    font-family: 'Open Sans',sans-serif,helevetica;
    font-size: 15px;
    font-weight: 300;
    height: auto;
    margin:8px 0px 3px 0px;
    text-align: center;
}
.websitename {
   -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #fff;
    border-color: #cccccc;
    border-image: none;
    border-style: solid solid solid solid;
    border-width: 1px 1px 1px 1px;
    color: #888;
    float: left;
    font-family: 'Open Sans',sans-serif,helevetica;
    font-size: 18px;
    font-weight: 300;
    height: 52px;
    margin-bottom: 6px;
    margin-left: 0;
    margin-top: 6px;
    text-align: left;
    width: 360px;
}
input.grnbutton {
    background-color:#83b633;
    color: #ffffff;
    cursor: pointer;
    font-family:'Open Sans', sans-serif,Helvetica;
    font-size:17px;
    font-weight: 500;
    height: 53px;
    line-height:28px;
    text-align: center;
    text-decoration: none;
    width: auto;
    letter-spacing:-0.5px;
    border:0;
    padding:10px;
    margin-bottom:15px;
    margin-top:10px;
}
.copypass {
	padding:20px 15px;
}
.showopts {
	width:360px;
	text-align:right;
}
.labelname {
    color: #484848;
    font-family: 'open sans',sans-serif,Helvetica;
    font-size: 14px;
    line-height: 17px;
    margin-bottom: 10px;
    padding-top: 10px;
    text-align: left;
	font-weight:500;
	letter-spacing:0.1px;
}
span.toolstext {
    color: #484848;
    font-family: 'open sans',sans-serif,Helvetica;
    font-size: 17px;
    line-height: 24px;
    margin-bottom: 10px;
    padding-top: 10px;
    text-align: left;
    font-weight:500;
    letter-spacing:0.1px;
}
.clear {
    clear: both;
}
.floatright {
    float:right;
}
.floatleft {
    float:left;
}
    p.toolheading {
    color: #555;
    font-family: 'open sans',sans-serif,Helvetica;
   font-size: 28px;
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1em;
    padding-top: 10px;
    text-align: left;
}
.toolsrunningtxt {
    color: #888;
    font-size: 12px;
    letter-spacing: 0.5px;
    line-height: 18px;
    padding: 15px 0 5px;
    text-align: left;
}
              
            
!

JS

              
                function generatePassword() 
{	
	var passInfo = passwordInfo();
	var passLengthMax = 50;
	passInfo.passLength = document.passform.passwordLength.value;
	if(passInfo.passLength > passLengthMax)
	{
		showMsg("Please provide password length less than "+passLengthMax); // No I18N
		return;	
	}
	//passInfo.specialCharacters = document.passform.splcharstext.value;
	passInfo.useNumbers = document.passform.numbers.checked;
	passInfo.useLowerCaseAlphabets = document.passform.lowercase.checked;
	passInfo.useUpperCaseAlphabets = document.passform.uppercase.checked;
	//passInfo.useSpecialCharacters = document.passform.ownspecialchars.checked;
	passInfo.useDefaultSpecialChars = document.passform.defaultspecialchars.checked;
	passInfo.avoidAmbiguousChars = document.passform.avoidAmbiguous.checked;
	var password = PasswordGenerator.generatePass(passInfo);
	document.passform.password.value = password;
	copyPassword(document.getElementById('password'));
}

var PasswordGeneratorConstants = {
	LOWER_CASE : "abcdefghijklmnopqrstuvwxyz", // No I18N
	UPPER_CASE : "ABCDEFGHIJKLMNOPQRSTUVWXYZ", // No I18N
	NUMBERS	   : "0123456789",
	LOWER_CASE_NON_AMBIGUOUS : "abcdefghijkmnpqrstuvwxyz", // No I18N
	UPPER_CASE_NON_AMBIGUOUS : "ABCDEFGHJKLMNPQRSTUVWXYZ", // No I18N
	NUMBERS_NON_AMBIGUOUS	 : "23456789",
	DEFAULT_SPL_CHARS	 : "[email protected]#$%^&*()"
}

var passwordInfo = function PasswordInfo(){
    	this.passLength;
	//this.specialCharacters;
	this.useNumbers;
	this.useLowerCaseAlphabets;
	this.useUpperCaseAlphabets;
	this.useDefaultSpecialChars;
	//this.useSpecialCharacters;
	this.avoidAmbiguousChars;
	return this;
}	

var PasswordGenerator ={};

PasswordGenerator.generatePass = function(passwordInfo){

	var length = passwordInfo.passLength;
	var charset = "";
	var password = "";
	if(passwordInfo.avoidAmbiguousChars)
	{
		if(passwordInfo.useNumbers)
		{
			password += PasswordGeneratorConstants.NUMBERS_NON_AMBIGUOUS.charAt(Math.round(Math.random() * (PasswordGeneratorConstants.NUMBERS_NON_AMBIGUOUS.length-1)));
			length -= 1;
			charset = charset+PasswordGeneratorConstants.NUMBERS_NON_AMBIGUOUS;
		}
		if(passwordInfo.useLowerCaseAlphabets)
		{
			password += PasswordGeneratorConstants.LOWER_CASE_NON_AMBIGUOUS.charAt(Math.round(Math.random() * (PasswordGeneratorConstants.LOWER_CASE_NON_AMBIGUOUS.length-1)));
			length -= 1;
			charset = charset+PasswordGeneratorConstants.LOWER_CASE_NON_AMBIGUOUS;
		}
		if(passwordInfo.useUpperCaseAlphabets)
		{
			password += PasswordGeneratorConstants.UPPER_CASE_NON_AMBIGUOUS.charAt(Math.round(Math.random() * (PasswordGeneratorConstants.UPPER_CASE_NON_AMBIGUOUS.length-1)));
			length -= 1;
			charset = charset+PasswordGeneratorConstants.UPPER_CASE_NON_AMBIGUOUS;
		}
	}	
	else
	{
		if(passwordInfo.useNumbers)
		{
			password += PasswordGeneratorConstants.NUMBERS.charAt(Math.round(Math.random() * (PasswordGeneratorConstants.NUMBERS.length-1)));
			length -= 1;
			charset = charset+PasswordGeneratorConstants.NUMBERS;
		}
		if(passwordInfo.useLowerCaseAlphabets)
		{
			password += PasswordGeneratorConstants.LOWER_CASE.charAt(Math.round(Math.random() * (PasswordGeneratorConstants.LOWER_CASE.length-1)));
			length -= 1;
			charset = charset+PasswordGeneratorConstants.LOWER_CASE;
		}
		if(passwordInfo.useUpperCaseAlphabets)
		{
			password += PasswordGeneratorConstants.UPPER_CASE.charAt(Math.round(Math.random() * (PasswordGeneratorConstants.UPPER_CASE.length-1)));
			length -= 1;
			charset = charset+PasswordGeneratorConstants.UPPER_CASE;
		}
	}
	/*if(passwordInfo.useSpecialCharacters && document.passform.splcharstext.value != "")
	{
		password += passwordInfo.specialCharacters.charAt(Math.round(Math.random() * (passwordInfo.specialCharacters.length-1)));
		length -= 1;
		charset = charset+passwordInfo.specialCharacters;
	}
	else */
	if(passwordInfo.useDefaultSpecialChars)
	{
		password += PasswordGeneratorConstants.DEFAULT_SPL_CHARS.charAt(Math.round(Math.random() * (PasswordGeneratorConstants.DEFAULT_SPL_CHARS.length-1)));
		length -= 1;
		charset = charset+PasswordGeneratorConstants.DEFAULT_SPL_CHARS;
	}
	
	//Shuffling the charset
	var shuffledCharSet = "";
        var stringLength = charset.length;
        for(var i=0; i < stringLength;i++)
        {
                var randomNumber = Math.round(Math.random() * (charset.length-1));
                if(randomNumber == charset.length-1)
                {
                        shuffledCharSet += charset.charAt(randomNumber);
                        charset = charset.slice(0, randomNumber)
                }
                else
                {
                        shuffledCharSet += charset.charAt(randomNumber);
                        charset = charset.slice(0, randomNumber) + charset.slice(randomNumber+1);
                }
        }

	//picking the remaining characters for password
    	for (var i = 0, n = shuffledCharSet.length; i < length; ++i) 
	{
		var randomNumber = Math.round(Math.random() * (n-1));
		password += shuffledCharSet.charAt(randomNumber);
    	}

	//shuffling the final password
	var shuffledPass = "";
        var passLength = password.length;
        for(var i=0; i < passLength;i++)
        {
                var randomNumber = Math.round(Math.random() * (password.length-1));
                if(randomNumber == password.length-1)
                {
                        shuffledPass += password.charAt(randomNumber);
                        password = password.slice(0, randomNumber)
                }
                else
                {
                        shuffledPass += password.charAt(randomNumber);
                        password = password.slice(0, randomNumber) + password.slice(randomNumber+1);
                }
         }

     return shuffledPass;
}

function copyPassword(passElement) 
{
    var selectionStart, selectionEnd;
    target = passElement;
    selectionStart = passElement.selectionStart;
    selectionEnd = passElement.selectionEnd;
    var currentFocus = document.activeElement;
    target.focus();
    target.setSelectionRange(0, target.value.length);
    
    var success;
    try 
    {
    	  success = document.execCommand("copy");
    } 
    catch(e) 
    {
        success = false;
    }

    if (currentFocus && typeof currentFocus.focus === "function") {
        currentFocus.focus();
    }
   
    passElement.setSelectionRange(selectionStart, selectionEnd);
    
    var message = "";
    if (!success) 
    {
        	message = "Copy is not supported by the browser"
    } 
    else 
    {
	        message = "Copied the password successfully!"
    }
    showMsg(message);
}

function showMsg(message)
{
	document.getElementById("message").innerHTML = message;
    	setTimeout(function() {
        document.getElementById("message").innerHTML = "";
    	}, 3000);	
}


              
            
!
999px

Console