For each data.row 1,2,3,4 that is equal to > i want to add class to that specific element.
For example, if data.row1 is equal to > i want to add style to row1. How is that possible with a more efficient way? This is mainly for code reduction and optimization since my code consists of more than 20 lines doing the same thing.
Just a small note, data.row is a variable that comes from php with Json Encode.
if(data.row1 === ">"){ $("#row1").addClass("Green");}
if(data.row2 === ">") {$("#row2").addClass(Green);}
if(data.row3 === ">"){ $("#row3").addClass(Green);}
if(data.row4 === ">") {$("#row4").addClass(Green);}