5

I have div element and inside that few more element like UL , span etc.

So, how can i clone the element like jquery clone.

Please don't suggest http://www.jsrosettastone.com/ because i already checked there.

1 Answer 1

6
YUI().use('node', function(Y){
   var node = Y.one('#doc');
   var clone = node.cloneNode(true); // true tells it to do a deep clone
});

It's in the YUI API docs: http://yuilibrary.com/yui/docs/api/classes/Node.html#method_cloneNode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.