K
K
kar1m2021-07-14 11:00:15
JavaScript
kar1m, 2021-07-14 11:00:15

Why is the link to the html node not working?

The problem is, I create an html node using document.createElement and assign it to a variable. After I change the html in the code using this variable, it often works, and sometimes it doesn't work. It seems that there is a value in the variable, if you add a class, for example, in the variable it appears in the classList, but nothing happens in the html. It turns out that there is a link to the node, but it is no longer relevant. Why is this happening?
Interactions with dom occur in this way https://codesandbox.io/s/suspicious-tesla-2rl4h?fi... , this code is working, but within the program it may stop behaving correctly, that is, manipulations using this.$ root where the node is stored don't produce any results.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question