Hi,
I'm afraid those IDs are invalid. IDs cannot contain spaces.[1] Do
you mean to be uses classes, perhaps?
But leaving aside that issue, yes, $$ can do substring matches within
attributes using substring attribute selectors[2]. So for instance,
if you used underscores instead:
<div id='one_two_three'>alpha</div>
<div id='one_three'>beta</div>
<div id='three_one'>gamma</div>
<div id='three'>delta</div>
Then $$("[id*=three]") would match all four divs above.
HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com
[1] http://www.w3.org/TR/html401/types.html#type-name
[2] http://www.w3.org/TR/css3-selectors/#attribute-substrings
On Oct 8, 10:27 am, lodecesa <[email protected]> wrote:
> I have two strings 'part1' and 'partF'.
>
> I want to get the reference to the element that have the two strings
> in its id:
>
> <input type="text" id="partA part1 part2 partD">
> <input type="text" id="partB part1 part3 partE">
> <input type="text" id="partC part1 part4 partF">
> <input type="text" id="partD part1 part5 partG">
>
> I can use the $$ utility?
>
> Thanks.
> Lorenzo
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---