<!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=gb2312" />
<title>表单对象属性过滤器</title>
<script type="text/javascript" src="jquery-1.7.js"></script>
</head>
<body>
<form id="myform" action="#">
可用元素<input type="text" value=""/><br />
不可用元素<input type="text" value="" disabled="disabled"/>
<input type="checkbox" value="南京" />南京
<input type="checkbox" value="合肥" />合肥
<input type="checkbox" value="上海" />上海
<input type="button" onclick="length()" value="弹出"/>
</form>
</body>
<script type="text/javascript">
$("#myform input:disabled").val("不可用元素写入值");
</script>
<script type="text/javascript">
var $length=$("#myform input:checked").length;
function length(){
alert("你一共选中:"+$length+"个元素");
}
</script>
</html>
Jquery实战学习--表单属性过滤器
最新推荐文章于 2024-11-09 19:53:09 发布