stronghasu / js-study

0 stars 0 forks source link

10강 과제 #15

Open stronghasu opened 10 months ago

stronghasu commented 10 months ago

      // 숙제2
      function form_check() {
        let ID = document.getElementById("id").value;
        let PW = document.getElementById("pw").value;
        let PW_length = document.getElementById("pw").value.length;
        if (ID == "") {
          alert("아이디를 입력해주세요.");
          return false;
        } else if (PW == "") {
          alert("패스워드를 입력해주세요.");
          return false;
        } else if (PW_length < 6) {
          alert("비밀번호를 6자 이상 입력해주세요.");
          return false;
        }
      }