깃허브주소: https://github.com/kimLrLr/js_form
배포주소: https://kimlrlr.github.io/js_form/
index.html을 홈페이지로 두고, header을 통하여 홈페이지, 로그인페이지, 회원가입 페이지로 이동할 수 있게 해둠.
회원가입과 로그인 시 유효성검사 필요!
if (usernameEl === "") {
errorMessageEl.innerText = "빈 값은 사용하실 수 없습니다.";
} else if (usernameEl.length < 2) {
errorMessageEl.innerText = "아이디는 2자리 이상 작성해 주세요.";
} else if (passwordEl.length < 8) {
errorMessageEl.innerText = "패스워드는 8자리 이상 작성해 주세요.";
} else if (usernameEl !== user.username) {
errorMessageEl.innerText = "아이디가 틀렸습니다.";
} else if (passwordEl !== user.password) {
errorMessageEl.innerText = "패스워드가 틀렸습니다.";
} else {
window.location.href = "./index.html";
// window.location.href = "../index.html";
}
=> if문을 사용하여 유효성 검사를 해보았음