开发者

setting background-color in IE via Jquery

I am trying to set a divs background color via

var color = "#FF0000";
$('#main_con开发者_开发知识库tent_bg').css('background-color', color);

This works everywhere except IE (I have 8 installed);

The only thing I can think of is that I need to cast the color value to a number somehow.

Does anyone know why this wouldn't work?

thanks


Why Dont you try with

$('#main_content_bg').addClass("The Class that set color");

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜