Answer the question
In order to leave comments, you need to log in
Added elements not responding to mouseenter?
In table 1, the line is set when loading, and I add the second through append.
There are elements in the line (for example, a picture with a basket). The JS file contains the code $(.del_ico).mouseenter(function() { действия });
. On hover, the image changes.
The mouseenter event does not fire on the newly added row.
My guess is that the script $(.del_ico).mouseenter(function() { actions }); does not see newly added elements or am I stupid somewhere?
Answer the question
In order to leave comments, you need to log in
Of course he doesn't. Google for "javascript event delegation".
Or just read the textbook .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question