Edit in JSFiddle

function securePassword(length) {
    var chars = "abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>ABCDEFGHIJKLMNOP123456789";
    var pass = "";
    for (var x = 0; x < length; x++) {
        var i = Math.floor(Math.random() * chars.length);
        pass += chars.charAt(i);
    }
    return pass;
}

function generate() {
    generator.row_password.value = securePassword(generator.length.value);
}
<div style="padding:15px;">
<h2>Secure Password Generator</h2>
<p>
Enter the # of Characters you would like your password to be.
</p>
<form name="generator" method="post" action="">
<input type="text" name="length" value="" class="characters"><br>
<p>Click on Generate to acquire your new secure password.</p>

<input name="row_password" type="text" size="20">&nbsp;<input type="button" class="button" value="Generate" onclick="generate();" tabindex="2">
</form></div>