user1814174 user1814174 - 2 months ago 6
Ajax Question

jQuery selector for ajax loaded content

I have used this library:

and in order to use it I should use syntax like below:


or any other javascript selector.
But my textarea loaded by ajax and it is not working.

Is there any other selector that works with ajax elements?
Thank you


Just wrap the jquery selector around it and use .find() to narrow it down.

    // depending on what the function is doing you may need to append it to the body first.
    $(responseHTML).appendTo('body'); // or wherever you want to put it
    $textarea = $(responseHTML).find('#description');