Forum Moderators: open

Message Too Old, No Replies

jQuery: Accessing elements created from AJAX

They appear not to be part of the DOM. How can I get at them?

         

sawatkins

10:11 pm on Mar 27, 2009 (gmt 0)

10+ Year Member



I used some AJAX to generate a drop-down box. This drop-down box, however, will not respond to the .change() event.

I assume this is because it is not a part of the DOM when the page loads.

I tried making making a blank form when the page loaded, but that didn't work. So, how can I access this new form?

Your advice is greatly appreciated.

Gus

whoisgregg

8:50 pm on Mar 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not familiar with jQuery, so my advice may not be helpful. In the Prototype library, it is sometimes necessary to call Element.extend() on dynamically created DOM elements so that they have all the Prototype hooks.

Perhaps there is something similar for jQuery? If not, I hope someone with more jQuery experience can post and help here. :)