커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
function q1,q2가 syntex error라고 뜹니다.
undefined주차
북마크
안*수
댓글
8
추천
0
조회수
10
조회수
10
답변 완료


function q1,q2가 syntex error라고 뜹니다.




<script>
    function q1() {
        let txt = $('#input-q1').val()
        if (txt == '') {
            alert('빈칸입니다')
        } else {
            alert(txt)
        }
    }

    function q2() {
        let txt = $('#input-q2').val()
        if  (txt.includes('@')) == true) {
            alert(txt.split('@')[1].spli('.')[0])
        } else {
                alert('이메일이 아닙니다')
        }

    }

    function q3() {
        // 1. input-q3 값을 가져온다. let txt = ... q1, q2에서 했던 걸 참고!
        // 2. 가져온 값을 이용해 names-q3에 붙일 태그를 만든다. (let temp_html = `<li>${txt}</li>`) 요렇게!
        // 3. 만들어둔 temp_html을 names-q3에 붙인다.(jQuery의 $('...').append(temp_html)을 이용하면 굿!)
    }

    function q3_remove() {
        // 1. names-q3의 내부 태그를 모두 비운다.(jQuery의 $('....').empty()를 이용하면 굿!)
    }

</script>






취소
 공유
취소
댓글 0
댓글 알림
나의얼굴