How can I pass a variable and a string into the same jQuery selector?
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 gener开发者_如何学Pythonal to pass variables (even on their own) through jQuery?
You need to concatenate the two strings together:
$(x+',#thumb').show();
精彩评论