title: Change Text And Background Color Of Table Cell Based On Text Value
body: <p>I have a table with three columns as follows:</p>
  
  <p>CATEGORY | ITEM | <strong>STATUS</strong></p>
  
  <p>The table is populated with data from a php script</p>
  
  <p>I need to make sure that the cells under the header "STATUS" will change to be of red background and white text color if a value of "PRIORITY" is the result of the php data import.</p>
  
  <p>Here is my js script</p>
  
  <pre><code>&lt;script&gt;
  function c_color(){
  if (document.getElementById('CellColor').value = 'PRIORITY') {
  document.getElementById('CellColor').style.color = "white";
  document.getElementById('CellColor').style.background="red";
  }
  }
  c_color();
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is the HTML/PHP that calls the function</p>
  
  <pre><code>&lt;td id="CellColor" style="background-color: #92c38e; text-align: 
  center;"&gt;
  &lt;span style="color: #ffffff; font-size: medium;"&gt;
  &lt;?php print strip_tags($category[0]['status']); ?&gt;&lt;/span&gt;&lt;/td&gt;
  </code></pre>
  
  <p>As a result I get only the first cell with the red and white colors but this isn't even showing a value of "PRIORITY"</p>
  
  <p>I have tried and re-tried but I can't get it right, any help will be greatly appreciated.</p>