my current css looks like this for class "firstTri"
.firstTri{
width: 0;
height: 0;
border-top: 160px solid transparent;
border-bottom: 160px solid transparent;
border-left: 160px solid gray;
}
I want to change the color of this triangle to yellow, so I have:
$('.firstTri').css("border-right","160px solid yellow");
which works but what if I want to update the color with the values in this array:
samples = [
{
values : ["blue", "red", "green", "blue", "yellow"],
},
{
values : ["...etc"],
}
];
I was thinking something like this:
$('.firstTri').css("border-right","160px solid samples[i].values[j]");
i and j increment, i increments after j ends
For example, the second index is red, so that would be
samples[0].values[1]
$('.firstTri').css("border-right","160px solid " + samples[i].values[j]);