Today's Question:  What does your personal desk look like?        GIVE A SHOUT

Solution to IE setAttribute style problem

  Pi Ke        2011-11-21 12:00:27       4,148        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  SOLUTION  SETATTRIBUTE  IE  NOT WORK 

Share on Facebook  Share on Twitter  Share on Weibo  Share on Reddit 

  RELATED


  0 COMMENT


No comment for this article.