This is by design, so it's not a bug.

For some methods like clone, append, contains on Array take precedence over
methods with the same name on Element.

You can easily solve this by using:

var cloned = $$('div').map(function(el){
    return el.clone();
});

If it would be the other way around, it would be harder.

On Tue, Feb 28, 2012 at 9:00 AM, Aaron Newton <[email protected]> wrote:

> this doesn't clone the elements but rather creates two sets. If you did
> this with elements from a selector, you'd need to invoke .clone on each
> element ($$('div').invoke('clone'))
>
>
> On Mon, Feb 27, 2012 at 11:50 PM, Sanford Whiteman <[email protected]>wrote:
>
>> > Am I missing something totally obvious?
>>
>> (In  the  middle  of responding when Aaron's came in, so I figure I'll
>> post anyway.)
>>
>> Kinda.  You only have three elements -- you never cloned the elements.
>> The arrays each contain references to those same three elements. Clone
>> the els (following your own pattern):
>>
>>    http://jsfiddle.net/D4qNB/3/
>>
>> -- S.
>>
>>
>>
>

Reply via email to