0

So I've just been getting into jquery, been reading some tutorials and I've found myself very confused to do with event delegation/rebinding

Basically:

User clicks "Show Users"
result is retrieved using jquery and is a HTML forms and placed into
<div id="listusers"></div>

Then when they click the submit button jquerys unable to catch the onclick event I think because it's an added element, so how would I go about this?

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by bonfire89
0

With jquery you can use .live() to attach a function to an event. The use of live allows you to define functions on elements, even if they are not available yet. My guess is you currently use bind(), which only attaches to elements currently in the DOM.

0

Thank you very much this solved my entire problem I am so happy! :)

0

With jquery you can use .live() to attach a function to an event. The use of live allows you to define functions on elements, even if they are not available yet. My guess is you currently use bind(), which only attaches to elements currently in the DOM.

I signed up just to say thank you. This Advice was extremely helpful. Thank you very much!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.