jquery checkbox 체크박스 및 라디오버튼 간단히 체크 상태인지 확인

js API/jquery 2012. 5. 4. 22:55

jQuery를 이용해 checkbox 또는 라디오버튼이 체크 상태인지 확인 하는 심플 방법



< html >
< input type="checkbox" id="isemail" value="Y" />
< /html>

< script>
$('#isemail').click(function (){
       if( $(this).is(':checked') ){ //true
            alert('true');
       }else{
            alert('false');
       }
});
< /script>