I am trying to dynamically add javascript for new elements I obtain & add to the page through ajax. So I can dynamically add javascript using the createElement("script") and appendChild for elements already on the page, but for new elements I just added through ajax, that doesn't seem to work. Any suggestions how I can achieve this?
btw I am adding new DOM elements using .innerHTML += instead of appendchild for each, since there is quite a lot of new elements. Does that matter?
Thanks.
innerHTMLandappendchildserve entirely different purposes. You should be careful in your use of either. You might also find it useful to play around withstyle.displayandstyle.visibiltyattributes.