Link to home
Start Free TrialLog in
Avatar of MJ
MJFlag for United States of America

asked on

Event Listener Status of Dynamically Removed/Created Element

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

Avatar of Francisco Igor
Francisco Igor
Flag of Canada image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MJ