• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clone Node Problems in IE

 
Arulanand Dayalan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am cloning an Select Box which has an Onchange function associated with it. This function takes an input parameter - id. It clones sucessfully, but onChange function is not working for the Cloned node. The same script works in FireFox but not in IE. I am trying to fix this problem for more 1 day. But couldn't. Can you provide some suggesstions to fix this issue. I am attaching test to simulate the problem. Thanks in Advance.



Regards,
Arul.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change

clonedNode.setAttribute("onchange","alert(this.id)");

to

clonedNode.onchange = function(){alert(this.id); };

Eric
 
Arulanand Dayalan
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. That worked out.

Regards,
Arul.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic