= 'true') {
                nameErr.textContent = 'Username taken - Try another name!';
            } else {
                nameErr.textContent = '';
            }
        });
    });

    //    Validate passwords
    //    listen for submit button click
    btnSubmit.addEventListener('click', function(e){
        var ok = validatePasswords();
        if (!ok) {
            e.preventDefault();
            return;
        }
    });

    function validatePasswords() {
        pErr.textContent = '';
        i