I have a HTML form where the variables are pulled from JSON. The variable can be “In Progress”, “Pending” or “Completed”.
Is it possible to keep the background of Form based on variable?
The HTML code is below:
$(function() {
$.getJSON('C:/GChartServlet/end.json', function(statusDataSet) {
$.each(statusDataSet.statuses, function(i, f) {
if(f.name=="Autogen Program") {
$("#end1").append(f.value);
}
else if(f.name=="Auto Approval Program") {
$("#end2").append(f.value);
}
else if(f.name=="Time Transfer from OTL to BEE") {
$("#end3").append(f.value);
}
});
});
});
I was trying to keep the form background or even value in different color depending on value it pulls from JSON.
I am new to HTML coding. Any help is appreciated.
Regards.