jQuery clone written in Javascript