Used detach() instead of empty() so event handlers would stay in place.

patch @jcornelius