I simply have a table with a bunch of ✔ X and a few other symbols, how can I change the class of a cell based on it's contents?
jQuery example:
$(function(){$("td:has('✔')").addClass("tick"); });
$(function(){$("td:has('X')").addClass("cross"); });
This is also covered in post jQuery select based on text.
You can widdle down the set of TD elements to only those td elements whose text exactly matches your expectations.
$("td")
.filter
(
function()
{
return $(this).text() === "✔";
}
)
.addClass("tick");