prototypejs - Prototype $$ returns array, should return one element like $ -


when using dollar-dollar-function in prototype alway array of elements back, instead of 1 element dollar-function. how can combine power of css-selectors of $$ still 1 element back?

changing structure of source not possible, can't select id. needs selected css, should return 1 element.

it not make sense return single element when selecting class name because potentially there many elements in dom have class. use first element of returned array if sure unique.

$$('.foo')[0] 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -