by YOUR NAME

setDefaultPasswordText:

Goal:

Add default text to a password field.

Support mobile browsers and screen readers.

Example:

Implementation notes:

HTML:

<div class="default-password-text">
    <label for="password" id="passwordDefault">Enter password</label>
    <input type="password" id="password" name="password" value="" />
</div>

<div class="default-password-text">
    <label for="verifyPassword" id="verifyPasswordDefault">Verify password</label>
    <input type="password" id="verifyPassword" name="verifyPassword" value="" />
</div>
        

CSS:

default-password-text.css

JavaScript:

setDefaultPasswordText('#password', '#passwordDefault');
setDefaultPasswordText('#verifyPassword', '#verifyPasswordDefault');
        

default-password-text.js