Jquery獲取radio選中的值
更新時間:2017年05月05日 16:55:03 作者:yangzailu1990
本文主要介紹了Jquery獲取radio選中值的相關(guān)知識,具有很好的參考價值。下面跟著小編一起來看下吧
先給大家分享一篇關(guān)于Jquery獲取radio選中的值的實例內(nèi)容
Jquery獲取radio選中值實例總結(jié)
http://www.dhdzp.com/article/154831.htm
話不多說,請看代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="" />
<style type="text/css"></style>
<script type="text/javascript" src="jquery-3.0.0.js"></script>
</head>
<body>
<input type="radio" name="radio" value="1" />1<br/>
<input type="radio" name="radio" value="2" />2<br/>
<input type="radio" name="radio" value="3" />3<br/>
<input type="radio" name="radio" value="4" />
<script type="text/javascript">
var a = $("input[name='radio']:checked").val();
alert("選中的radio的值是:" + a);
</script>
</body>
</html>
以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學習或者工作能帶來一定的幫助,同時也希望多多支持腳本之家!
相關(guān)文章
jQuery圖片特效插件Revealing實現(xiàn)拉伸放大
本文給大家分享的是jQuery圖片展示效果,使用的是jQuery Revealing插件,不點擊的情況下,圖片整齊排列成一行,當任意一個圖片縮略圖被點擊的時候,該圖片就放大顯示,當點擊關(guān)閉按鈕時圖片又重新還原了縮略圖模式。2015-04-04
jquery append()方法與html()方法的區(qū)別及使用介紹
append()方法在被選元素的結(jié)尾插入指定內(nèi)容,html()方法返回或設置被選元素的內(nèi)容,下面為大家介紹下兩者的區(qū)別及使用2014-08-08
jquery異步循環(huán)獲取功能實現(xiàn)代碼
頁面html的repeater控件中有一個span,需要根據(jù)指定ID異步獲取相關(guān)信息。2010-09-09

