Morning,
I am setting the class of a td when i return data from the database to show changes/updates.
On one of the returned fields i have 4 options and i need to change the css class of that field depending on the result.
"<td" + (res.prodPublished ? "" : " class='updated'") + ">" + res.prodPublished + "</td>"
I am currently using the above, which is ok if you have just true or false. I however have…
True, False, Processing, New.
How can i change the class, depending on these options?
Thanks in advance.
With a js function?
Then within your HTML code:
Method 2:
Or you can just make CSS classes of the values:
Then in HTML:
Hope this helps!