$('input[type=radio]')
형식은 $(':radio')
으로 축약할 수 있음
checked
확인 방법은 여러가지가 있음
1) if ($('input[type=checkbox]:checked').length > 0) {}
-제이쿼리 전용 메서드-
2) if ($('input[type=checkbox]').prop('checked') == true) {}
3) if ($('input[type=checkbox]').is(':checked') == true) {}
attr()
은 DOM에서 불러오는 형식, 따로 함수를 이용해서 추가되는 것 인식X
prop()
은 배열로 불러오는 형식, 따로 함수를 이용해서 추가되는 것 인식O
(boolearn 타입으로 불러옴 true/false)
.on(event,eliment,function)
메서드를 사용해서, .toggleClass
클래스 추가를 통한 if구문으로 완성
.mouseover()
메서드와 .mouseout
메서드 사용해서 이벤트 실행
.on()
메서드를 활용할 때는 객체 형태로 사용
$(':submit').on({
mouseover: function() {
$(this).after('<p>입력한 내용을 서버로 전송합니다.</p>')
},
mouseout: function() {
$(this).next().remove();
}