개발일지 과제 2

손은채·2021년 7월 15일
0
<script>
    function q1() {
        let txt = $(`#input-q1`).val();
        if (txt == '') {
            alert('입력하세요!')
        } else {
            alert(txt)
        }
    }

    function q2() {
          let txt = $(`#input-q2`).val();

            if (txt.includes('@')) {
               let domain = txt.split('@')[1].split('.')[0]
                alert(domain)
            } else {
                alert('이메일이 아닙니다.')
            }
    }

    function q3() {
        let txt = $(`#input-q3`).val();
        let temp_html = `<li>${txt}</li>`

        $('#names-q3').append(temp_html)

    }

    function q3_remove() {
        $('#names-q3').empty()

    }

</script>
profile
해볼게요!

0개의 댓글