getElementsBySelector search string

6 views
Skip to first unread message

Yozefff

unread,
Oct 30, 2009, 10:49:36 AM10/30/09
to Prototype & script.aculo.us
Ok,

let's day I have 2 elements :

<input type='text' name='myname_1'>

and

<input type='text' name='myname_2'>


So now I want to get all the elements wich has a name starting with
"myname_"

is this possible with getElementsBySelector?

Alexander Wallace

unread,
Oct 30, 2009, 10:55:37 AM10/30/09
to prototype-s...@googlegroups.com
$$("[name^='myname_']") should return all elements with names that begin with myname_

Prototype has great CSS3 selectors support: check out:
http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#selectors

Yozefff

unread,
Oct 30, 2009, 10:57:43 AM10/30/09
to Prototype & script.aculo.us
wow .... that worked like a charm!!! thnx

On 30 okt, 15:55, Alexander Wallace <alexmlwall...@gmail.com> wrote:
> $$("[name^='myname_']") should return all elements with names that begin
> with myname_
>
> Prototype has great CSS3 selectors support: check out:http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#selectors
>
Reply all
Reply to author
Forward
0 new messages