1
如何向一組單選按鈕中的選定單選按鈕添加和移除課程?將課程添加到選定的單選按鈕
<table class="radioClass" role="set1"><tbody><tr><td><input type="radio" value=" Yes " id="" name="j_id0:j_id37:j_id41"> label for="j_id0:j_id37:j_id41:0"> Yes </label></td><td><input type="radio" value=" No " id="" name="j_id0:j_id37:j_id41"<label for="j_id0:j_id37:j_id41:1"> No </label></td></tr></tbody></table>
$(document).ready(function(){
$("input[type='radio']").click(function(){
var radioValue = $("input:checked").val();
if(radioValue){
//alert("Your are a - " + radioValue);
$("input:checked").toggleClass("checked");
}
});
請檢查:https://jsfiddle.net/8gwf2bx6/1/ – vijayP