javascript - Why does JQuery write [object Object] to the DOM when I try to append an element? -


simplified, have:

if (value instanceof jquery && target instanceof jquery) {    target.append(value); } 

and it's appending this:

[object object] 

i've tried converting value html:

if (value instanceof jquery && target instanceof jquery) {    target.append(value.html()); } 

same result.

i've tried setting target's html, rather appending elem:

if (value instanceof jquery && target instanceof jquery) {    target.html(value.html()); } 

same result.

can point me in right direction?

value this, when inspected in debugger:

z.fn.init[1]  0: span.jc-template-formatted-currency context: span.jc-template-formatted-currency length: 1 prevobject: z.fn.init[1] __proto__: z[0] 

target created large class won't include here, here's basics:

$(document.getelementbyid('protos').queryselector('.jc-template-formatted-currency')).clone().find(targetselector); 

(protos template store in dom).

so target not in dom @ time of appending value. target first pushed array , appended container ($('.container)) various other elements later)


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -