<fieldset id="sample_f" data-role="controlgroup" data-type="horizontal"> <legend>二度押しで選択解除できるラジオボタン</legend> <input type="radio" id="r1" value="radio1" name="sample_r"/><label for="r1">radio1</label> <input type="radio" id="r2" value="radio2" name="sample_r"/><label for="r2">radio2</label> <input type="radio" id="r3" value="radio3" name="sample_r"/><label for="r3">radio3</label> </fieldset> <button>確かめてみる</button>
$(document).on("click","input:radio:checked + label",function(event){ var $radio = $("#" + $(this).attr("for")); $radio.prop("checked", false).checkboxradio("refresh"); event.preventDefault(); event.stopPropagation(); }); $("button").on("click",function(event){ alert($("input:radio:checked").val()); });