function q1() {
$('#input-q1').val()
if ($('#input-q1').val() == '') {
alert('입력하세요!')
} else {
alert($('#input-q1').val())
}
}
function q1() {
let txt = $('#input-q1').val()
if (txt == '') {
alert('입력하세요!')
} else {
alert(txt)
}
}
function q2() {
$('#input-q1').val()
let txt = $('#input-q1').val()
if (txt.includes('@') == true){
alert(txt.split('@')[1].split('.')[0])
}else{
alert('이메일이 아닙니다.')
}
}
// 1. input-q2 값을 가져온다.
// 2. 만약 가져온 값에 @가 있으면 (includes 이용하기 - 구글링!)
// 3. info@gmail.com -> gmail 만 추출해서 ( .split('@') 을 이용하자!)
// 4. alert(도메인 값);으로 띄우기
// 5. 만약 이메일이 아니면 '이메일이 아닙니다.' 라는 얼럿 띄우기
선택한 요소의 내용이 지워지는 JQuery 메서드
$('#names-q1').empty()
$.ajax({
type: "GET",
url: "여기에URL을입력",
data: {},
success: function(response){ //
console.log(response)
}
})