We help IT Professionals succeed at work.

Event Listener Status of Dynamically Removed/Created Element

894359
894359 asked
on
73 Views
1 Endorsement
Last Modified: 2018-12-27
What happens to an event listener which was attached to an element that gets dynamically removed and then dynamically recreated?  If I have a form and an event listener is attached to an element by ID (e.g. ID="f1") and then that element is removed while the even listener is attached;, will the event listener automatically go away or error? Additionally what happens if the element reappears (is recreated dynamically) after the initial attachment? This is in regards to the sequence below.

1) event listener A is attached to element with ID= "f1"
2) element "f1" is dynamically removed while event listener is attached
3) element "f1" is dynamically recreated

Thanks!
Comment
Watch Question

Developer
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.