Ignore the people that are suggesting that the property name is the issue. The jQuery API documentation explicitly states that either notation is acceptable: http://api.jquery.com/css/
The actual problem is that you are missing a closing curly brace on this line:
$(“#myParagraph”).css({“backgroundColor”:”black”,”color”:”white”);
Change it to this:
$(“#myParagraph”).css({“backgroundColor”: “black”, “color”: “white”});
Here’s a working demo: http://jsfiddle.net/YPYz8/
$(init);
function init() {
$(“h1”).css(“backgroundColor”, “yellow”);
$(“#myParagraph”).css({ “backgroundColor”: “black”, “color”: “white” });
$(“.bordered”).css(“border”, “1px solid black”);
}
Header
This is some paragraph text
You can do either:
$(“h1”).css(“background-color”, “yellow”);
Or:
$(“h1”).css({backgroundColor: “yellow”});