I have some kind of problem with jQuery selectors.
Let\'s say i want to select $(\'#elementID\')
but the elementID
is a variable.
Not really, no. You need "#" as a selector to select an ID. No reason to not use the ID selector. Or you could write your own function, something like:
$.id = function(id)
{
return $("#" + id);
}
var elementID = "elementID";
$.id(elementID).text();
That would return an element with the ID of "elementID" without having to use the "#". Kind of pointless though.