Hi i'm learning prototype and i need to know something...
Someone knows how to write and get the value of some atribute... i
mean like...jquery that uses $('#sub-div').atrr('alt','visible);
in prototype is there something like that?...
I hope you can help me and thanks :D
on 2008-07-05 06:54
on 2008-07-05 12:11
Zell,
I'm fairly new to Prototype myself but I believe the syntax you're
looking for is:
$('tag').readAttribute('title');
http://www.prototypejs.org/api/element/readAttribute
-William
on 2008-07-06 06:14
Hey thanks!! it really helped me a lot!...
One mor thing, have anyone knows...how to tell lik...$$
('.class:visible').not($(this).find('div');
in prototype, i know that there is a function that is findElement();
but..i do not know if there's something like the .not(); that has
jquery... and i'm changin to prototype :D
thanks a lot
on 2008-07-06 18:34
I'm not sure what jQuery's .find does, but you can use #reject to find
all "hidden" elements (since prototype.js only supports "standard"
selectors):
$$('.class').reject(Element.visible)
Note that since Element.visible only checks actual element's style, it
will skip any elements which have "hidden" parents.
-- kangax
on 2008-07-06 21:48
What initially threw me in jQuery was filter() vs. find(). filter() gets the *subset* of elements that match some selector, where find() gets the * children* of elements that match some selector. -Fred On Sun, Jul 6, 2008 at 11:33 AM, kangax <kangax@gmail.com> wrote: > > I'm not sure what jQuery's .find does, but you can use #reject to find > all "hidden" elements (since prototype.js only supports "standard" > selectors): > $$('.class').reject(Element.visible) > Note that since Element.visible only checks actual element's style, it > will skip any elements which have "hidden" parents. > > -- kangax -- Science answers questions; philosophy questions answers.