jquery radio 單選 按鈕 實現 取值 動態 選中 刪除 各類 方法 欄目 JQuery 简体版
原文   原文鏈接

  本文主要講的是在jquery裏操做表單radio單選按鈕的各類方法,如獲取選中的radio的值,動態選中指定的radio項等。javascript

1.獲取選中的radio單選按鈕的值:java

var v=$(":radio[name='aijquery']:checked").val();

2.動態選中第一個或最後一個radio單選按鈕:jquery

$(":radio[name='aijquery']:first").attr("checked","true");
$(":radio[name='aijquery']:last").attr("checked","true");

3.動態選中第n個radio單選按鈕:code

$(":radio[name='aijquery']").eq(3).attr("checked","true");

4.動態選中值爲7的radio單選按鈕:blog

$(":radio[name='aijquery'][value='7']").attr("checked","true");

5.動態刪除值爲5的radio單選按鈕:ip

$(":radio[name='aijquery'][value='5']").remove();

  

出處:http://www.aijquery.cnrem

相關文章
相關標籤/搜索
每日一句
    每一个你不满意的现在,都有一个你没有努力的曾经。
本站公眾號
   歡迎關注本站公眾號,獲取更多信息