i have a html table
<table class="mytable">
<tr>
<td>
test value
</td>
<tr>
</table>
on loading the page dynamically adding a td
$(".mytable tr:first").append("<td id='scheduledInMyLearnStatus' class='changeFieldValue' style='background-color:#FE2E2E;'></td>");
now on clicking the that particular td i want to compare whether its has backgroung color =#FE2E2E
or has anything else
$('td').live('click', function() {
//compare here
});
You can use jQuery
css()method, please note thatlive()is deprecated you can useoninstead:DEMO