In IE7, the JavaScript setAttribute("style","attributes") doesn't work, but it works in IE 8 and other web browsers. To solve the STYLE problem in IE 7 we can use a workaround method.
we can use
element.style.cssText = 'color:#FF0000;';
in IE 7 instead of
element.setAttribute('style','color:#FF0000;');