Don E Posted February 28, 2012 Share Posted February 28, 2012 I have an event listener like so(this is the internet explorer segment of the code): arrange.attachEvent("onclick", displayArrange); ...and then in the displayArrange function.. I have this: this.className = "on"; It's suppose to take what the arrange element is, which is a span tag and set a class to it called 'on'. It works in all browsers but in IE8, it doesn't. Everything gets ran properly but the class(styling) isn't being set to the element which is the span tag. Maybe.. in IE8.. the keyword this doesn't work? I was also thinking maybe it's the styling that's being applied and that IE8 doesn't render it, but I don't think so. Perhaps it is.. Here's the styling for class 'on': background: url("../images/tabsbg.gif") repeat-x scroll 0pt 0pt transparent; border-color: #D7DBDC #D7DBDC -moz-use-text-color; border-style: solid solid none; border-width: 1px 1px medium; color: #666666; font-weight: bold; I appreciate the input. Thanks. Link to comment Share on other sites More sharing options...
ShadowMage Posted February 28, 2012 Share Posted February 28, 2012 There's a good article here. Basically, The event handling function is referenced, not copied, so the this keyword always refers to the window and is completely useless. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.