Overriding CSS property using jQuery -
suppose have following css in linked style sheet:
td {background: -moz-linear-gradient(top, #fbfbfb, #fafafa);}
this makes table columns green.
suppose have following table row:
<tr id="myrow"><td>stuff</td><td>more stuff</td></tr>
the whole row green following user input want following:
$("#myrow").children('td').css('backgroundcolor', 'red');
why won't turn row green red , how can make work without adding !important
style sheets?
you can try:
$("#myrow").children('td').css('background-color', 'red');
or
$("#myrow").children('td').css('background', 'red');
also bizzare things check if above won't work:
- where call jquery code? (is in function,
$(document).ready()
..?) - do have inline
style
attribute there? - do have errors caused previous code? (see debugger - built-in chrome dev tools of firebug)
Comments
Post a Comment