欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jQuery實(shí)現(xiàn)復(fù)選框成對選擇及對應(yīng)取消的方法

 更新時間:2015年03月03日 15:59:44   作者:代碼家園  
這篇文章主要介紹了jQuery實(shí)現(xiàn)復(fù)選框成對選擇及對應(yīng)取消的方法,實(shí)例分析了jQuery中change方法的使用技巧,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)復(fù)選框成對選擇及對應(yīng)取消的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

復(fù)制代碼 代碼如下:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery實(shí)現(xiàn)復(fù)選框成對選擇,對應(yīng)取消功能</title>
<script type="text/javascript" src="/js/jquery-1.6.2.min.js"></script>
<script>
$(function(){
 var classA = $(".classA");
 classA.change(function(){
  classA.attr("checked",Boolean($(this).attr("checked")));
 })
 var classB = $(".classB");
 classB.change(function(){
  classB.attr("checked",Boolean($(this).attr("checked")));
 })
})
</script>
</head>
<body>
<p>A組</p>
<input type="checkbox" class="classA">
<input type="checkbox" class="classA">
<p>B組</p>
<input type="checkbox" class="classB">
<input type="checkbox" class="classB">
</body>
</html>

希望本文所述對大家的jQuery程序設(shè)計有所幫助。

相關(guān)文章

最新評論