Using $$ returns a collection.

Using methods like getActive will return an array with the results for each
element with that method in the collection.

$$('a.select').getPrevious(); is more or less the same as

$$('a.select').map(function(el){
     el.getPrevious();
});

In the jsfiddle this results in [null], null is the result of the method on
the single element in the collection.

active should be a single element, so you should use var active =
document.getElement('a.selected').
Then using active.getPrevious() will return the desired null.


On Sun, Mar 4, 2012 at 8:44 PM, hamburger <[email protected]> wrote:

> Hello, is this a bug or just me?
>
> http://jsfiddle.net/gtxeu/2/
>
> If you click to the points the console has to show you that there is
> no previous class="first selected"
>
> but the value is true.
>
> any idea??
> thanks
>

Reply via email to