internet explorer - Javascript modification on page not being reflected in IE -



internet explorer - Javascript modification on page not being reflected in IE -

i used javascript modify style on page , alert modified style. in ie v7, though alerted message shows alter has been made, visual rendering of page shows no difference. same code works fine in ff. reason be? thing noted when used developer toolbar's script console able expected results not when set js in script tag.

sample code -

function change() { var text=document.getelementsbytagname("h2"); var i=0; var p=text[0]; while(p) { alert(p.style.csstext); p.style.csstext="color:#565656;"; p.innerhtml="changed"; alert(p.parentnode.innerhtml); i++; p=text[i]; } }

this set in script tag , set within body test. alter made innerhtml or style not reflected in ie browser window though later javascript alert shows change.

instead of changing style way, straight set "color" property:

p.style.color = '#565656';

javascript internet-explorer dom

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -