You have to escape the first set of double quotes -- leave the single
quotes there.
var tabTest = "billy";
$(".orderInfo[id='" + tabTest + "'"];
On Jan 30, 7:24 am, studiobl <[EMAIL PROTECTED]> wrote:
> I'm having trouble with a jQuery selector that contains a variable.
> I'm trying to target an
you can try $('#' + tabtext) since the id is unic you don't need the
class.
On Jan 30, 7:24 am, studiobl <[EMAIL PROTECTED]> wrote:
> I'm having trouble with a jQuery selector that contains a variable.
> I'm trying to target an element that has a class of "orderInfo" and an
> id of "billy"
>
> So
Hi,
as Karl said...and you could also make things a little bit shorter by using
multiple selector:
var tabText = 'billy';
$('.orderInfo#'+tabText];
--
Bohdan
--
View this message in context:
http://www.nabble.com/Selector-Containing-Variable-tp15188162s27240p15194100.html
Sent from the jQuer
On Jan 30, 2008, at 10:24 AM, studiobl wrote:
I'm having trouble with a jQuery selector that contains a variable.
I'm trying to target an element that has a class of "orderInfo" and an
id of "billy"
So, I set a variable:
var tabText = "billy";
...and it works if I use the string:
$(".ord
4 matches
Mail list logo