Using .on()
you can define your function once, and it will execute for any dynamically added elements.
for example
$('#staticDiv').on('click', 'yourSelector', function() {
//do something
});
More Related Contents:
- Click event doesn’t work on dynamically generated elements [duplicate]
- jQuery find events handlers registered with an object
- How can I trigger the same function from multiple events with jQuery?
- jQuery ‘input’ event
- How can I recognize touch events using jQuery in Safari for iPad? Is it possible?
- jQuery – Trigger event when an element is removed from the DOM
- Custom events in jQuery?
- How to have click event ONLY fire on parent DIV, not children?
- How do I hide an element on a click event anywhere outside of the element?
- javascript capture browser shortcuts (ctrl+t/n/w)
- jQuery select change event get selected option
- Delay jquery hover event?
- How to detect input type=file “change” for the same file?
- How can I check if a key is pressed during the click event with jQuery?
- How do I detect a page refresh using jquery?
- event.originalEvent jQuery
- Accessing functions bound to event handlers with jQuery
- Trigger change() event when setting ‘s value with val() function
- Events not registering after replaceWith
- jquery how to catch enter key and change event to tab
- jquery fullcalendar event filtering
- jquery live event for added dom elements
- How do I explicitly execute default action from jQuery event
- jquery Event.stopPropagation() seems not to work
- how to unbind all event using jquery
- triggerHandler vs. trigger in jQuery
- Jquery how to bind click event on dynamically created elements?
- Backbone.js Event Binding
- Detect user scroll down or scroll up in jQuery [duplicate]
- Jquery .on(‘scroll’) not firing the event while scrolling