I am using ASP.NET webmethods. When the data comes back from the server, I refresh the HTML labels through the jQuery DOM. I need to build a conditional which turns these labels red if negative and green if equal to or greater than zero.
This is the code I have:
function OnSuccess(response) {
document.getElementById('<%=lbDetalleEvo.ClientID %>').innerHTML = response.d[1];
document.getElementById('<%=lbDetalleEvo.ClientID %>').style.color = "#00B050";
document.getElementById('<%=lbDetalleEvo_p.ClientID %>').innerHTML = response.d[2];
document.getElementById('<%=lbDetalleEvo_p.ClientID %>').style.color = "#00B050";
}
Try it like this: