楼主把代码拷贝下去直接运行看看,jQuery库已经远程引用了,是要这个效果吗?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRansitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dTD">
<html>
<head>
<title>DEMO1</title>
</head>
<body>
<html>
<head>
<script src="http://media.pec365.com/rainnoless/javascript/jquery-1.3.2.min.js" type="text/javascript"></script>
</head>
<body>
<input type="checkbox" name="chk_list" id="chk_list_1" value="1" />1<br />
<input type="checkbox" name="chk_list" id="chk_list_2" value="2" />2<br />
<input type="checkbox" name="chk_list" id="chk_list_3" value="3" />3<br />
<input type="checkbox" name="chk_list" id="chk_list_4" value="4" />4<br />
<input type="checkbox" name="chk_all" id="chk_all" />全选/取消全选
<script type="text/javascript">
$("#chk_all").click(function(){
$("input[name='chk_list']").attr("checked",$(this).attr("checked"));
$("input[name='chk_list']").each(function() {
window.alert(this.value);
});
});
</script>
</body>
</html>
</body>
</html>