View Full Version : IE bug when setting events on elements..

10-12-2004, 06:08 AM
I tested this on IE6 on two different computers..

text = document.createElement('textarea');
//text.onfocus = "alert(1)";
//text.onFocus = "alert(1)";

It works in Fx but not in IE
I Googled to see if it was a known bug but did not find any information-- maybe I wasn't using the proper search terms. I also tried the above with onblur which still yielded no results, the attribute is set but the event just does not occur.
I will use innerHTML instead unless you have another suggestion..

Willy Duitt
10-12-2004, 10:07 AM
text.onfocus = function(){alert(1)};

10-12-2004, 11:49 AM
wahoo! thanks willy.