Solution to IE setAttribute style problem

  Pi Ke        2011-11-21 12:00:27       4,359        0    

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;');

JAVASCRIPT  STYLE  SETATTRIBUTE  IE  NOT WORK  SOLUTION 

       

  RELATED


  0 COMMENT


No comment for this article.



  RANDOM FUN

This is pretty good