반응형
안녕하세요
jQuery로 체크박스 체크 여부 및 체크하고, 체크 풀기 소스입니다.
자바스크립트
if($("#isChecbox").is(":checked")){
alert("체크박스가 체크되어있습니다.");
} else {
alert("체크박스가 체크되어있지 않습니다.");
}
// jQuery로 체크박스 체크 및 체크풀기
$("#isChecbox").attr("checked", true); // 체크하기
$("#isChecbox").attr("checked", false); // 체크풀기
HTML
<input type="checkbox" name="isChecbox" id="isChecbox" value="1" />
감사합니다.
반응형
'IT 소스 > jQuery' 카테고리의 다른 글
[jQuery] .addClass() (0) | 2023.02.16 |
---|---|
[jQuery] .attr() (0) | 2023.02.16 |
[jQuery] .show() (0) | 2023.02.15 |
[jQuery] .hide() (0) | 2023.02.15 |
jQuery로 숫자만 입력 받기 (0) | 2017.04.06 |