Home > Web Front-end > JS Tutorial > How jquery determines whether the input data in the same column and different rows of the table is repeated_jquery

How jquery determines whether the input data in the same column and different rows of the table is repeated_jquery

WBOY
Release: 2016-05-16 16:48:10
Original
1836 people have browsed it
Copy code The code is as follows:

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;
}
}

//Call
alert( hasRepeat(tableID, column index)==1?"There are duplicates":"No duplicates");
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template