admin管理员组

文章数量:1315807

i used

mycurrent_row.setAttribute("bgcolor", "#EEF4EA");

it worked for both firefox and chrome.but no color was set in ie

i use

mycurrent_row.setAttribute("bgcolor", "#EEF4EA");
mycurrent_row.bgcolor = "#EEF4EA";

it neither work.

How can i set the row's color in IE?

i used

mycurrent_row.setAttribute("bgcolor", "#EEF4EA");

it worked for both firefox and chrome.but no color was set in ie

i use

mycurrent_row.setAttribute("bgcolor", "#EEF4EA");
mycurrent_row.bgcolor = "#EEF4EA";

it neither work.

How can i set the row's color in IE?

Share Improve this question asked Nov 19, 2012 at 9:17 MaxMax 8,04510 gold badges36 silver badges39 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

The attribute is named bgColor, not bgcolor, but you should rather use the backgroundColor CSS property for styling instead of the deprecated HTML attribute bgColor:

mycurrent_row.style.backgroundColor = "#EEF4EA";

You can set the style inline

mycurrent_row.setAttribute("style", "background:#EEF4EA");

本文标签: javascripthow to set the table39s row background color in IEStack Overflow