Home > Article > Web Front-end > Solve the binding problem of events after Jquery appends new elements to the page_jquery
I first looked at the jq api documentation but couldn't find a method. To no avail, I had to look for some information online, and sure enough I found a live method.
It’s actually very simple:
1. This is the effect required by the project. When I did not use the live event and only used a simple hover event: the hover event was not loaded and there was no border effect I wanted. The rendering is as follows
2. After I used live, the effect was achieved, as shown below:
The code is as follows:
I carefully read the introduction about live,
Bind an event handler (such as hover event) to all current and future matching elements. Custom events can also be bound.
PS: I am a newbie, please don’t criticize!
The above is the entire content of this article, I hope you all like it.