I’m trying to do the following but keep failing:
I have a variable:
var targg = "new-house";
And I would like to use the value of the variable to target the element with that id:
However I’m trying to do that inside a set of parameters and it does not work.
Here is the final Code:
var targg = "new-house";
$(this).someFunction({
para1: true,
para2: "string",
para3: "#"+targg
});
This however works:
$(this).someFunction({
para1: true,
para2: "string",
para3: "#new-house"
});
It is probably very easy but I cannot find it!!
Hope that it is clear.
Thanks
1 Answer