When the picture is clicked, the function is also triggered, but I did not bind it to the img. .
给我你的怀抱2017-06-12 09:31:01
Use event.currentTarget, event.target returns the element that triggered the event, and event.currentTarget returns the element that bound the event
黄舟2017-06-12 09:31:01
It should be img in p. You can click on the picture to trigger the event. You can print it and it will come out
女神的闺蜜爱上我2017-06-12 09:31:01
Because there is an event bubbling mechanism, when you click img
, the binding event of the parent p
will also be triggered.