A saved reference of an element that does not exist (JS) #120126
Replies: 2 comments 3 replies
-
When dealing with asynchronous addition and removal of elements in the DOM, it’s essential to handle references correctly to avoid issues like the one you described
|
Beta Was this translation helpful? Give feedback.
-
Hey @ZigglerPL, Thanks for posting in the community! Can you explain what you mean by "reference remains when using, for example, the children method"? |
Beta Was this translation helpful? Give feedback.
-
Body
Hello, how can I bypass the reference of an element that no longer exists in the DOM structure?
My problem is that as a result of asynchronous addition of elements to a container that initially contains one element, this element is removed when the first element is added to the container, but its reference remains when using, for example, the children method.
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions