Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5935 closed bug (invalid)

Attached events is lost on empty()

Reported by: petter@… 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.. :)

Change History (1)

comment:1 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

Can you put together a complete test case and reopen with an attachment? Thanks!

Note: See TracTickets for help on using tickets.