jquery單選框radio綁定click事件實(shí)現(xiàn)方法
更新時(shí)間:2015年01月14日 15:02:54 投稿:shichen2014
這篇文章主要介紹了jquery單選框radio綁定click事件實(shí)現(xiàn)方法,可實(shí)現(xiàn)針對單選框radio值的改變作出響應(yīng),非常具有實(shí)用價(jià)值,需要的朋友可以參考下
本文實(shí)例講述了jquery單選框radio綁定click事件實(shí)現(xiàn)方法。分享給大家供大家參考。
具體實(shí)現(xiàn)方法如下:
復(fù)制代碼 代碼如下:
<html>
<head>
<title>單選框radio綁定click事件</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(":radio").click(function(){
alert("您是..." + $(this).val());
});
});
</script>
<style type="text/css">
h5{color:blue;}
textarea{resize:none;}
#word{color:red;}
</style>
</head>
<body>
<h5>單選框 radio 綁定 click 事件</h5>
<form action="" method="">
<input type="radio" name="gender" value="男性">男性
<input type="radio" name="gender" value="女性">女性
<input type="radio" name="gender" value="春哥">春哥
</form>
</body>
</html>
<head>
<title>單選框radio綁定click事件</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(":radio").click(function(){
alert("您是..." + $(this).val());
});
});
</script>
<style type="text/css">
h5{color:blue;}
textarea{resize:none;}
#word{color:red;}
</style>
</head>
<body>
<h5>單選框 radio 綁定 click 事件</h5>
<form action="" method="">
<input type="radio" name="gender" value="男性">男性
<input type="radio" name="gender" value="女性">女性
<input type="radio" name="gender" value="春哥">春哥
</form>
</body>
</html>
希望本文所述對大家的jQuery程序設(shè)計(jì)有所幫助。
您可能感興趣的文章:
相關(guān)文章
jQuery基于cookie實(shí)現(xiàn)的購物車實(shí)例分析
這篇文章主要介紹了jQuery基于cookie實(shí)現(xiàn)購物車的方法,結(jié)合實(shí)例形式簡單分析了jQuery基于cookie實(shí)現(xiàn)針對商品信息的購物車存儲(chǔ)功能,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-12-12
jQuery實(shí)現(xiàn)定時(shí)讀取分析xml文件的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)定時(shí)讀取分析xml文件的方法,涉及jquery通過定時(shí)器采用Ajax方法讀取并處理XML文件的相關(guān)技巧,需要的朋友可以參考下2015-07-07
基于jQuery實(shí)現(xiàn)列表循環(huán)滾動(dòng)小技巧(超簡單)
只要能夠不停地把第一個(gè)item移動(dòng)到末尾,其余的自會(huì)往上填補(bǔ)空缺,填補(bǔ)的過程用動(dòng)畫放慢些,就能有不斷滾動(dòng)的視覺效果了,這種效果基于jquery怎么實(shí)現(xiàn)呢?下面小編給大家?guī)砹薺Query列表循環(huán)滾動(dòng)效果的實(shí)現(xiàn)思路代碼,一起看看吧2021-08-08
基于jQuery實(shí)現(xiàn)滾動(dòng)刷新效果
這篇文章主要為大家詳細(xì)介紹了基于jQuery實(shí)現(xiàn)滾動(dòng)刷新效果,使用Ajax獲取后臺(tái)數(shù)據(jù)更新前端頁面,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-01-01
jQuery setTimeout傳遞字符串參數(shù)報(bào)錯(cuò)的解決方法
這篇文章主要介紹了jQuery setTimeout傳遞字符串參數(shù)報(bào)錯(cuò)的解決方法,需要的朋友可以參考下2014-06-06

