<span style="font-size:18px;"><!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"></span>
<span style="font-size:18px;"><span style="white-space:pre"> </span><span style="color:#ff0000;">//jQuery版本根据实际版本选择</span>
<script type="text/javascript" src="js/jquery-2.2.4.js"></script>
</head>
<body>
<form>
<input type="button" value="Input Button"/><br/>
<input type="checkbox" /><br/>
<input type="file" /><br/>
<input type="hidden" name="id" value="123"/><br/>
<input type="image" src="../images/lb.jpg" width="25px" height="25px"/><br/>
<input type="password" /><br/>
<input type="radio" /><br/>
<input type="reset" /><br/>
<input type="submit" /><br/>
<input type="text" /><br/>
<select><option>Option</option></select><br/>
<textarea></textarea><br/>
<button>Button</button><br/>
</form>
<script type="text/javascript">
//1)查找所有input元素的个数
//alert( $("input").size() );//10,找input标签
//alert( $(":input").size() );//13,找input标签和select/textarea/button
//2)查找所有文本框的个数
alert($(":text").size());
//3)查找所有密码框的个数
alert($(":password").size());
//4)查找所有单选按钮的个数
alert($(":radio").size());
//5)查找所有复选框的个数
alert($(":checkbox").size());
//6)查找所有提交按钮的个数
alert($(":submit").size());
//7)匹配所有图像域的个数
alert($(":image").size());
//8)查找所有重置按钮的个数
alert($(":reset").size());
//9)查找所有普通按钮的个数
alert($(":button").size());
//10)查找所有文件域的个数
alert($(":file").size());
//11)查找所有input元素为隐藏域的个数
alert($(":input:hidden").size());
</script>
</body>
</html>
</span>