I have a jQuery variable that I wanna use as the selector. The variable contains colon, ':', as seen in the example below.
var testVariable = text1:text2:4882746225
The variable id used as the id of a div element and I cannot remove the colons. There is another div element inside the parent div. Below you can see how it looks.
<div id="text1:text2:4882746225">
<div class="inner">
Sample content
</div>
</div>
What I want to do is to select the inner div element, which has the class inner, via the parent div's id. I have tried the following but it didn't work.
$('#'+testVariable+' .inner')
Does anyone else have run into a similar problem? If so, what is the solution? What am I doing wrong here?
Thanks in advance.