首页 > Web开发 > 详细

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

时间:2017-02-18 22:36:11      阅读:331      评论:0      收藏:0      [点我收藏+]

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数据是否重复

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!