You have it as a native DOM method already:

var newElm = $('oldElm').cloneNode(true);

but the returned/cloned element isn't extended so you might want to
wrap in in a $() or Element.extend:

var newElm = $($('oldElm').cloneNode(true));


Martin

--
Sent from my computer

On 19/11/2007, Roland <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is there GOOD snippet/patch/you name it available to clone elements..
>
> var newElm = $('oldElm').clone();
>
> Roland =]
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to