[Manipulating innerHtml disables event handlers set with JavaScript]
If you manipulate innerHtml property of an HTML element with children and you've previously set any event handlers on those children with JavaScript (not with onxxxx attributes), they're gone (as the changing of innerHTML effectively erases all the children and recreates them). If you want to retain children event handlers, you should add new children with DOM calls (node.appendChild).
2008年11月21日星期五
Manipulating innerHtml disables event handlers set with JavaScript
訂閱:
張貼意見 (Atom)
0 意見:
張貼意見