views:

20

answers:

1

I have the following:

var x = '.'+this.id;  

and this does not work:

$(x,'#thumb').show();

but this does:

$(x).show();

and obviously so does this:

$('#thumb').show();

What am I missing? Should I be doing something else in general to pass variables (even on their own) through jQuery?

+2  A: 

You need to concatenate the two strings together:

$(x+',#thumb').show();
Jeevan Takhar