作者: tianshi0253 鏈接:http://tianshi0253.javaeye.com/blog/205001 發表時間: 2008年06月18日
聲明:本文系JavaEye網站發布的原創博客文章,未經作者書面許可,嚴禁任何網站轉載本文,否則必將追究法律責任!
<SCRIPT> function check(obj) { var checkboxList=obj.parentNode.getElementsByTagName("input"); var count=checkboxList.length; var flag=obj.checked; for(var i=0; i<count;i++){ checkboxList[i].checked=flag; } } </script> <form name=myform> <input type=checkbox onClick="check(this)"> <p> <input type=checkbox value="1" onClick="check(this)"> <input type=checkbox value="1"> <input type=checkbox value="1"> <input type=checkbox value="1"> <input type=checkbox value="1"> </p> <p> <input type=checkbox value="2" onClick="check(this)"> <input type=checkbox value="2"> <input type=checkbox value="2"> <input type=checkbox value="2"> <input type=checkbox value="2"> </p> </form>
本文的討論也很精彩,瀏覽討論>>
JavaEye推薦
- 搜狐網站誠聘Java、PHP和C++工程師
- Oracle專區上線,有Oracle最新文章,重要下載及知識庫等精彩內容,歡迎訪問。
- 北京: 千橡集團暨校內網誠聘軟件研發工程師
- 立刻報名,免費獲取門票,參加SOA技術論壇(廣州6月19日)
文章來源:http://tianshi0253.javaeye.com/blog/205001