As @boreddad420 pointed out, "when you clone the node and replace it, you remove all of the event listeners for that node".
If you try to add the click handler back in (on the new node), the onClick() function will still not be called, since the mouse activity was destined for the node that you have replaced.
"Basically I need to modify div contents", so do just that, modify the existing div, don't replace it. What is it about the div that you want to change? Perhaps we can help you out with that.