title: How To Replace Background Color Based on String Value in Javascript?
body: <p>I've trying this to create a dinamic background color. (Without reload all page)</p>
  
  <pre><code>if (status_val.length &gt; 0) {
  
      $.ajax({
          type: "POST",
          url: "update.php",
          data: dataString,
          cache: false,
          success: function (e) {
              $("#status_" + ID).html(status_val);
  
              var setstatus = $("#status_" + ID);
  
              if (setstatus.html().value == "Active") {
                  setstatus.style.background = "green";
                  return (false);
              } else if (setstatus.html().value == "Inactive") {
                  setstatus.style.background = "red";
                  return (false);
              }
              return (true);
  
          }
      });
  }
  </code></pre>
  
  <p>seems to only doing String function not the background. How can I replace selected background color?</p>