How do you escape parentheses in jQuery selector?

后端 未结 3 484
天涯浪人
天涯浪人 2020-12-06 11:07

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 trie

3条回答
  •  -上瘾入骨i
    2020-12-06 11:46

    I don't use jQuery much, but the problem with your first one is that you're trying to put in text where it should be a selector - then you tried using a selector ":contains", but you then tried to escape the "(". Have you tried $("#fscaTotals td").filter(":contains('(')")? Use contains, but don't try to escape the parentheses.

提交回复
热议问题