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

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -