trollolodn icon

#jquery #confirm checkbox

trollolodn | PRO | 03/21/13 04:35:01 AM UTC | 0 ⭐ | 228 👁️ | Never ⏰ | []
jQuery |

620 B

|

None

|

0 👍

/

0 👎

$("#checkbox").click(function(evt){
            $status = $('input').is(':checked');
           
            if($status == false){
                $arr = confirm('FALSE?');
                if($arr == true){
                    $(this).attr('checked', false);
                } else{
                    $(this).attr('checked', true);
                }
            } else{
                $arr = confirm('TRUE?');
                if($arr == true){
                    $(this).attr('checked', true);
                } else{
                    $(this).attr('checked', false);
                }
            } 
        });

Comments