jquery_220215_01

SEUNGJU BAEK·2022년 2월 15일
0

sparta

목록 보기
1/2
    function q1() {
        let txt = $('#input-q1').val();
        if (txt == '') {
            alert('입력하세요')
        } else {
            alert('txt')
        }
    }
    
    @@ 빈칸을 눌렀을 때 '입력하세요' 알림이 확인됩니다. @@
    

    function q2() {
        let txt = $('#input-q2').val();
        console.log(txt.includes('@'))
        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)
        
    @@ 이름을 입력하면 하단에 입력이 됩니다. @@
profile
I'm Jake!

0개의 댓글