JQuery each of nested using summaries
- 2020-03-30 02:40:50
- OfStack
Note: function(I){} can have an I to denote index. And JavaScript objects
var startObj = {}; //Declare 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";
}
});
});