|
JQuery获取input的name相同的值
<!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 src="jquery.js" type="text/javascript"></script>
<script>
$(function(){
$("input[name='uploadfile']").each(function(){
alert($(this).val());
});
});
</script>
</head>
<body>
<form>
<input name="uploadfile" value="1"/>
<input name="uploadfile" value="2"/>
<input name="uploadfile" value="3"/>
<input name="uploadfile" value="4"/>
<input name="uploadfile" value="5"/>
<input name="uploadfile" value="6"/>
</form>
</body>
</html>
|
|