How to uncheck radio button upon double clicking?

javascript, jquery

Solution

You can try

$(document).on('dblclick','.className',function(){
    if(this.checked){
        $(this).prop('checked', false);
    }
});

Demo: Fiddle

Problem

I want this functionality: When user clicks on already checked radio button, it should uncheck it. I'm trying this code but no luck. ``` $(document).on('mouseup','className',function(){ if ($(this).is(':checked')){ $(this).prop('checked', false); } }); ```

Original source

Related problems