This works :
var str ='<input id="a_49519498" type="radio" name="answers[10903336]" value="49519498" />cat,dog ';
if(str.search('cat,dog')!=-1)
{
alert("found ");
}
While this does not :
var str ='<input id="a_49519498" type="radio" name="answers[10903336]" value="49519498" />Rock (Foreigner, Nickelback, etc...) ';
if(str.search('Rock (Foreigner, Nickelback, etc...)')!=-1)
{
alert("found ");
}
I am guessing that this has something to do with the brackets that are present in
(Foreigner, Nickelback, etc...)
Why is JavaScript unable to find this string ? How can I make it work?