Queria que ao atender uma condição, o background da minha
for ( var a = 0; a < ultimo; a++) {
var qa = $("#qar_" + a).html();
var qd = $("#qd_" + a).html();
var result = (qa - qd).toFixed(2);
if(result < 0){
document.getElementById("#sa_" + a).style.background = red;
$("#sa_" + a).html(result);
} else {
$("#sa_" + a).html(result);
}
}