CSS attributes not working in jQuery
Hello All,
I am a newbie to jQuery. I am learning it of my own. While trying out some of the code given in the book, I found that passing CSS properties and values in the jQuery is not working somehow. Following is what I have written.
$(document).ready(function() {
$('#first tbody tr:even').css('background-color': '#dddddd',
'color': '#666666',
'font-size': '11pt',
'line-height': '2.5em');
});
Where as if I pass CSS properties in following way, it is working. But I would need to write multiple statements for that.
$('#first tbody tr:even').css('color', '#873450');
How can I resolve this issue? What is getting wrong in the initial code?
Thanks for helping me,
Ameya