Home >Web Front-end >JS Tutorial >Summary of nested use of JQuery each()_jquery

Summary of nested use of JQuery each()_jquery

WBOY
WBOYOriginal
2016-05-16 16:51:511548browse

Note: function(i){} can bring i, indicating index. And JavaScript object

Copy code The code is as follows:

var startObj = {}; //Declaration js object

$("#tabT").find("tr").each(function(i){
var uuid = '';
$(this).find(" input[type='hidden']").each(function(j){
if(j==0){
uuid = $(this).val();
}
startObj[uuid '_' j] = $(this).val();
});

});

$("#tabT").find(" tr").each(function()
{
var sameFlag = "1";
var uuid = '';
$(this).find("input[type='hidden' ]").each(function(j){
if(j==0){
uuid = $(this).val();
}
if(startObj[uuid '_ ' j]!=$(this).val()){
sameFlag = '0';
allSameFlag = "0";
}
});

} );
Statement:
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