Is to group the same attribute values and add different styles to ask for help.

clipboard.png

clipboard.png

is to group the same attribute values and add different styles

Mar.23,2021

for loop to compare the current data with the next data. If different, call the method to generate the background color to add the background


var json = {},arr= [],color=[];
for(var i in json){
    if(arr[i].include(json[i].phone)){
        var j = arr.indexOf(json[i].phone);
        //
        obj.style.background = color[j]
    }else{
       var j = arr.length;
       arr.push(json[i].phone)
       obj.style.background = color[j]
    }
}
.
Menu