">
1. In the append element in jquery, if the element has an id value and is bound to an event, the id event will be invalid and must be refreshed before it can be used.
2. Solution:
Example: If in a
, add a button with id="demo" through append , the commonly used direct$("Selector").on("eventType",function(){})
listening event function does not work. For example, the click listening event of the button should be written like this:
$(".title").on("click","#demo",function(){});
The above is the detailed content of The problem of invalid id binding event in jquery appaend element. For more information, please follow other related articles on the PHP Chinese website!