[jQuery] Re: Using variables in selectors? $("input[name=x]")

2009-03-13 Thread sergiugothic
hi, I am working on something like this I have about 20 groups, each group contains two paragraphs, one visible and one hidden; and two divs, one visible and one hidden. Each group have a unique id from mysql. What I am trying to do: When you click on a paragraph, all divs and paragraph

[jQuery] Re: Using variables in selectors? $("input[name=x]")

2009-02-18 Thread Zaliek
Works great! Thanks a bunch On Feb 18, 2:40 pm, James wrote: > Make sure your single-quotes is wrapping the actual name > > $("input[name='element12']") > becomes: > $("input[name='element" +myVar+ "']") > > Just do > > On Feb 18, 12:38 pm, Zaliek wrote: > > > Is it possible to add strings toge

[jQuery] Re: Using variables in selectors? $("input[name=x]")

2009-02-18 Thread James
Make sure your single-quotes is wrapping the actual name $("input[name='element12']") becomes: $("input[name='element" +myVar+ "']") Just do On Feb 18, 12:38 pm, Zaliek wrote: > Is it possible to add strings together or does that need to be done > outside in a variable? > Something like ($"in

[jQuery] Re: Using variables in selectors? $("input[name=x]")

2009-02-18 Thread Zaliek
Is it possible to add strings together or does that need to be done outside in a variable? Something like ($"input[name='element' + "+x+"]") On Feb 18, 2:00 pm, aquaone wrote: > ($"input[name="+x+"]") > > On Wed, Feb 18, 2009 at 13:56, Zaliek wrote: > > > I haven't found any mention of this in

[jQuery] Re: Using variables in selectors? $("input[name=x]")

2009-02-18 Thread aquaone
($"input[name="+x+"]") On Wed, Feb 18, 2009 at 13:56, Zaliek wrote: > > I haven't found any mention of this in the documentation. Can you use > a variable in place of a string when using a selector to match an > element in a page? If so, what is the syntax? > > x = foobar > $("input[name=x]")

[jQuery] Re: Using variables in selectors

2008-09-24 Thread Scott
Haha! Thanks! :P On Sep 19, 6:19 pm, MorningZ <[EMAIL PROTECTED]> wrote: > var pageName = "foobar.html"; > var link = $("a[href$='" + pageName + "']"); > link.addClass('selected');

[jQuery] Re: Using variables in selectors

2008-09-19 Thread MorningZ
var pageName = "foobar.html"; var link = $("a[href$='" + pageName + "']"); link.addClass('selected');