텍스트 상자 → type = “text”
패스워드 → type = “password”
체크박스 버튼 → type = “checkbox”
라디오 버튼 → type = “radio”
버튼 → type = “button”
리셋 버튼 → type = “reset”
submit 버튼 → type = “submit”
파일 → type = “file”
이미지 → type = “image” src = “ 링크 “
.prop("checked"), :checked
$("input:checkbox").change(checkedChange);
function checkedChange(){
console.log($(this).prop("checked"));
var bool = $(this).prop("checked");
if(bool){
$(this).css({"width":"50px", "height":"50px"});
} else {
$(this).css({"width":"15px", "height":"15px"});
}
};
</script>
change → 해당 요소에 변화가 일어나면 발생하는 이벤트