I have a jsp that contains a number of diffenent elements ids. Example:
<div id="divName">
...
<tr id="tr_0_123/45">
<input type="hidden" name="field_0_123/45" value="NAME_Field" id="field_0_123/45">
</tr>
</div>
The problem is that I need to be able to read the value field from my input. To do so I use
function workOnValue(){
var idTr = 'tr_0_123/45';
var idName = 'field_0_123/45';
${"#divName #"+idTr +" input[id='"+idName+"']).each(function(){
do something...
}
}
When I run this code the JQuery does not find any input with that id, meanwhile with any other kind of id that does not include the character / it does.
I tried $.escapeSelector
but my jQuery version is too old to work with it.
I tried to use idName.replace("/","\\/");
or .replace(/[|\(\)#\\\/]/g, '\\$&');
Do you have any suggestions?