[IE] javascript fails to execute for html elements generated on the fly

Discussion in 'JavaScript' started by spaceman12, Jul 11, 2011.

  1. #1
    Actually, When a user click on a button, I coded a script that generates a block of html elements sort of like this-
    <div id='some_id' onMouseOver='function()' onMouseOut='function()'>contents</div>

    and there, I have another script such that when a user clicks on the generated div elements, it should remove the attributes onMouseOver and onMouseout.

    
    document.getElementById(id).removeAttribute('onMouseOut');
    
    Code (markup):
    I got the expected result when executed under FF but IE simply fails to remove the attributes.
    Please help!
     
    spaceman12, Jul 11, 2011 IP
  2. tolas

    tolas Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    tolas, Jul 12, 2011 IP