日期:2014-05-16 浏览次数:20328 次
<!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=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
</head>
<body>
<script type="text/javascript">
function jc(){
var inValue = new Array();
$("input[name='currtQutar']").each(function(){
if($.inArray($(this).val(),inValue) != -1){
alert("已经存在该值:"+$(this).val());
}else{
inValue.push($(this).val());
}
})
console.log(inValue)
}
</script>
<input type='text' name="currtQutar" value="currtQutar" /><input type='text' name="currtQutar" value="currtQutar"/><input type='text' name="currtQutar" value="currtQutar1"/><input type='text' name="currtQutar" value="currtQutar2"/><input type="button" onclick="jc();" value="检查" />
</body>
</html>