S
S
seredaes2015-09-23 12:39:08
JavaScript
seredaes, 2015-09-23 12:39:08

Added elements not responding to mouseenter?

b2441d55e38041499ad275deea73d8b9.png
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

1 answer(s)
A
Alexey Ukolov, 2015-09-23
@seredaes

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 question

Ask a Question

731 491 924 answers to any question