Help sizzle select

9 views
Skip to first unread message

kstubs

unread,
Dec 14, 2012, 4:10:08 PM12/14/12
to prototype-s...@googlegroups.com
I have this

$('logins').select('li[class=\'' + group + '\']').invoke('show');

This seems to be matching on an exact class name though, but I have something like

<li class="seaside fav">Seaside</li>

So if group is "fav" or group is "seaside", then either should return the above.

Thanks for the help.  
Karl..

Jason Westbrook

unread,
Dec 14, 2012, 4:28:49 PM12/14/12
to prototype-s...@googlegroups.com


Try it this way

$('logins').select('li.seaside').invoke('show');

or 

$('logins').select('li.fav').invoke('show');

or with the variable

$('logins').select('li.'+group).invoke('show');


if you use the attribute selector instead of a class selector it will interpret it very literally instead of "this is what I meant"

Jason Westbrook | T: 313-799-3770 | jwest...@gmail.com



--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.
To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/R_8NmGQ1sdAJ.
To post to this group, send email to prototype-s...@googlegroups.com.
To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.

kstubs

unread,
Dec 14, 2012, 4:30:40 PM12/14/12
to prototype-s...@googlegroups.com
You unsizzled my sizzle!  But yeah, that will work just fine.  Thanks.
To unsubscribe from this group, send email to prototype-scriptaculous+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages