Thanks a lot ;-) That's what I want ;-) Thanks ;-)

On Jun 14, 12:02 am, kangax <[EMAIL PROTECTED]> wrote:
> For a precise matching:
>
> $$('div').findAll(function(el) {
>   return /^MyClass\[\d{1,4}\]$/.test(el.className);
>
> })
>
> Though such approach does indeed seem weird.
>
> - kangax
>
> On Jun 13, 1:32 pm, AlannY <[EMAIL PROTECTED]> wrote:
>
> > Param is a non constant value ;-)
>
> > For example, <div class="MyClass[4342]"> I want to extract: Element
> > (div), class name ("MyClass") and params ("4342"). So on.
>
> > On Jun 13, 8:52 pm, "Frederick Polgardy" <[EMAIL PROTECTED]> wrote:
>
> > > Not sure if [] is valid in a css class.  Why not use two classes?
>
> > > <div class="MyClass Param">
>
> > > $$('.MyClass.Param')
>
> > > or
>
> > > $$('.MyClass.' + someParam)
>
> > > -Fred
>
> > > On Fri, Jun 13, 2008 at 11:31 AM, AlannY <[EMAIL PROTECTED]> wrote:
>
> > > > I have a DIV in the following format: <div class="MyClass[Param]">
>
> > > > I want to parse it. Which approach is better? I can found all divs
> > > > with $$('.MyClass'), but how to find [Param] string?
>
> > > > Or, for me, it's better to use <div class="MyClass" id="Param"> and
> > > > then found all $$('.MyClass').each(function(el) { el.id })?
>
> > > > I think, the first method is better, than second one. But I don't know
> > > > how to implement it with Prototype.
>
> > > > Thank you.
>
> > > --
> > > Science answers questions; philosophy questions answers.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to