Prevent incorrect autofill of password

Example to stop browsers from automatically filling that aren't login forms. This is a hack, since many browsers get it wrong and there's no good standard for identifying login forms.

HTML

<form action="selfsubmit.php" method="post">
    User to search for:
    <input type="text" id="username">
    <br />(other selections that make up an override)
    <br />Password:
    <input type="text" id="password">
    <br />
    <button type="submit" name="submit" value="submit">Create override</button>
</form>

JavaScript

var process = function (that) {
        document.getElementById("password").setAttribute("type", "password");
    }
    if ('oninput' in document.createElement('input')) {
        $("#password").bind("input", function () {
            process(this)
        })
    } else {
        $("#password").bind("keyup", function () {
            process(this)
        })
    }