ector('#username-err');
    var pErr = document.querySelector('#password-err');

    //    username must be unique
    userName.addEventListener('keyup', function(){
        var json = JSON.stringify(userName.value);
        console.log(json);
        var xhr = new XMLHttpRequest();
        xhr.open('POST', '/api/checkUserName');
        xhr.send(json);
        xhr.addEventListener('readystatechange', function(){
            var item = xhr.responseText;
            if (item == 'true') {
                name