I am trying to check if a td innertext contains parentheses (). The reason is I display negative numbers as (1000) and I need to convert them to -1000 to do math. I've tried a couple different ways but can't seem to get it right. I know there are non-jquery ways to do this but at this point it's just bugging me.
$(tdElement[i]).find("\\(").length > 0
This doesn't throw error, but it doesn't find an innertext of (1000):
$(tdElement[i]).find("\\(")
{...}
context: {object}
jquery: "1.3.1"
length: 0
prevObject: {...}
selector: "\("
Another method I tried was:
$("#fscaTotals td").filter(":contains('\\(')")
This throws error "Exception thrown and not caught". It seems to work for other characters though. example: . , ; < >
so, how do you escape parentheses in jquery?