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
Post a Comment