码迷,mamicode.com
首页 > Web开发 > 详细

jquery如何判断表格同一列不同行input数据是否重复

时间:2017-02-18 22:37:04      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:不同   bsp   text   return   数据   this   cti   body   ret   

function hasRepeat(objId,columnIndex){ 
var arr = []; 
$("#"+objId+" tbody tr").each(function(){ 
arr.push( $("td:eq("+columnIndex+")",this).text() ); 
}); 
if( arr.length==$.unique( arr ).length ){ 
return false; 
}else{ 
return true; 



//调用 
alert( hasRepeat(tableID,列索引)==1?"有重复":"无重复" ); 

jquery如何判断表格同一列不同行input数据是否重复

标签:不同   bsp   text   return   数据   this   cti   body   ret   

原文地址:http://www.cnblogs.com/sjqq/p/6414205.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!