Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IE bug when setting events on elements..

    I tested this on IE6 on two different computers..
    Code:
    <body></body>
    <script>
    text = document.createElement('textarea');
    text.setAttribute('onFocus','alert(1)');
    //text.setAttribute('onfocus','alert(1)');
    //text.onfocus = "alert(1)";
    //text.onFocus = "alert(1)";
    document.body.appendChild(text)
    </script>
    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..
    Last edited by fci; 10-12-2004 at 05:17 AM.

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    text.onfocus = function(){alert(1)};

  • #3
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    wahoo! thanks willy.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •