static/js/site.js
/*
 * In all of the following:
 * - Create link between any inputs and their help text via aria-describedby
 * - Locate any errors and apply role="alert"
 * - Create link between errors and their associated inputs
 */
In all of the following:
- Create link between any inputs and their help text via aria-describedby
- Locate any errors and apply role="alert"
- Create link between errors and their associated inputs
In all of the following : - Create link between any inputs and their help text via aria - describedby - Locate any errors and apply role = " alert " - Create link between errors and their associated inputs
function handleLoginErrors() {
    var globalError = $('div.alert');
    if(globalError.length) {
        globalError.attr('role', 'alert');
        globalError.attr('id', 'login-error');
        var passwordInput = $('input[type="password"]');
        passwordInput.attr('aria-invalid', 'true');
        passwordInput.attr('aria-describedby', 'login-error');
        document.querySelector('input[type="password"]').focus();
    }
}
function handleLoginErrors ( ) { var globalError = $ ( 'div.alert' ) ; if ( globalError . length ) { globalError . attr ( 'role' , 'alert' ) ; globalError . attr ( 'id' , 'login-error' ) ; var passwordInput = $ ( 'input[type="password"]' ) ; passwordInput . attr ( 'aria-invalid' , 'true' ) ; passwordInput . attr ( 'aria-describedby' , 'login-error' ) ; document . querySelector ( 'input[type="password"]' ) . focus ( ) ; } }
In all of the following:
 - Create link between any inputs and their help text via aria-describedby
 - Locate any errors and apply role="alert"
 - Create link between errors and their associated inputs
In all of the following : - Create link between any inputs and their help text via aria - describedby - Locate any errors and apply role = " alert " - Create link between errors and their associated inputs
// Use native focus