I have a variable whose value is the same as an ID on the page. When I do this:
var foo = 'value';
$('#' + foo).thing();
it doesn't work. But this does work:
var foo = 'value';
var bar = '#' + foo; //'#value';
$(bar).thing();
How can I build that selector in a single line? Creating extra single-use variables seems wasteful.