javascript - How to Replace an element with another element entirely with data and events? -


i have cloned element this

var myvar = null; myvar = $(someothervar).clone(true, true) 

now want replace anothervar entirely myvar. how that?

i tried $(anothervar).replacewith(myvar) doesn't work. other way replace anothervar entirely data , events of myvar?

update

since want 2 references:

var myvar = $(someothervar).clone(true, true); var anothervar = $(myvar).clone(true, true);; 

if need 2 clones, have clone twice. there's no way around it.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -