Make pasteDiv removal compatible with older browsers