How can I combine a jQuery variable with some css class in the following example:
For example I can use this:
$("#wrapper .box")
But if #wrapper is stored in a variable, like:
var wrapper = "#wrapper";
This will not work:
$("wrapper .box")
In your code, you used it as a string, not a variable. Use the concatenation operation for that.
$(wrapper + " .box")