Opened 13 years ago
Closed 13 years ago
#5935 closed bug (invalid)
Attached events is lost on empty()
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | trivial | Milestone: | |
Component: | core | Version: | 1.4 |
Keywords: | eventhandling empty | Cc: | |
Blocked by: | Blocking: |
Description
This might not be a bug, but i'm filing it here anyway...
$("selector").click(doSomething);
works fine ofcours..
But if I take an element that has this event attached, moves and does
$("#someElement").append(someElementWithClick); the click event still works on both elements.
But if I do $("#someElement").empty(); the click event is removed from the original element..
The problem is solved by adding a .clone() $("#someElement").append(someElementWithClick.clone());
So I'm not sure if this is a bug or a feature.. :)
Note: See
TracTickets for help on using
tickets.
Can you put together a complete test case and reopen with an attachment? Thanks!