jQuery with elements generated dynamically

前端 未结 6 1614
旧巷少年郎
旧巷少年郎 2021-01-19 16:14

I\'ve been working with jQuery for a pair of weeks and I\'ve noticed it works fine with objects that are in the original HTML document, but when I generate a new element usi

6条回答
  •  渐次进展
    2021-01-19 16:45

    Thanks everybody.

    Somehow I thought elements were added to the DOM automatically by jQuery just by adding them anywhere.

    I've also found some extra information on the topic:

    http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F

    http://learningjquery.com/2008/03/working-with-events-part-1

    http://learningjquery.com/2008/05/working-with-events-part-2

    Just in case somebody else needs it.

提交回复
热议问题