jQuery selector problem when using a single parenthesis
问题 If I include a single parenthesis in a :contains selector I get an error. e.g. $("a:contains('Speed (mph')") returns the error Syntax error, unrecognized expression: (mph') if I add the closing parenthesis at the end, the statement runs fine. however, I need to be able to query where there is often a single parenthesis. What's going on here and how do I sidestep this? EDIT In my actual code the :contains part is passed in as a variable e.g var searchText = 'Speed (mph'; var result = $("a