IT/development
[jQuery] jQuery 버튼 클릭 시 table tr 숨김처리
알 수 없는 사용자
2022. 11. 24. 06:59
목차
버튼 클릭 시 table의 tr영역을 숨김처리하는 예제
// 체크박스가 체크 되어 있으면 table tr display none처리 예제
function check() {
$("#ch").change(function(){
if($("#ch").is(":checked")){
$("tr#one").css("display", "");
$("tr#two").css("display", "");
}else{
$("tr#one").css("display", "none");
$("tr#two").css("display", "none");
}
});
}
"$(#ch)"에 change이벤트를 줬고 체크여부를 체크해서 조건처리한 간단한 예제
내용이 너무 간단하긴 하다.
