Hi,

> It is easy to understand "findElement('a')", but what does it mean by
> the square brackets, as well as ^ just before equal? Is this a little
> bit of regular expression?

They're CSS attribute selectors, in particular the ^= is from CSS3:
http://www.w3.org/TR/css3-selectors/#attribute-selectors

> I don't find any document about this on prototype website.

Well...the docs for findElement says it uses CSS selectors. ;-) 'Tis a
bit subtle, though, and could use some expanding in my view.

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com


On Feb 24, 1:43 am, rocksoccer <rocksoccer2...@gmail.com> wrote:
> Hi,
> I am new to js prototype. This may be a very easy question.
>
> In lightbox 2 (http://www.huddletogether.com/projects/lightbox2)
> code,  I find the following code I cannot understand. Please help to
> explain it.
>
> var target = event.findElement('a[rel^=lightbox]') ||
> event.findElement('area[rel^=lightbox]');
>             if (target) {
>                 event.stop();
>                 this.start(target);
>             }
>
> It is easy to understand "findElement('a')", but what does it mean by
> the square brackets, as well as ^ just before equal? Is this a little
> bit of regular expression?
>
> I don't find any document about this on prototype website.
>
> Thanks in advance
> Rocksoccer

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to