Is there a case insensitive version of the :contains jQuery selector or should I do the work manually by looping over all elements and comparing their .text() to my string?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
A faster version using regular expressions.
The update code works great in 1.3, but "contains" should be lower case on the first letter unlike the previous example.
To make it optionally case insensitive: http://bugs.jquery.com/ticket/278
then use
:containsi
instead of:contains
May be late.... but,
I'd prefer to go this way..
This way, you DO NOT tamper with jQuery's NATIVE '.contains'... You may need the default one later...if tampered with, you might find yourself back to stackOverFlow...
Refer below to use ":contains" to find text ignoring its case sensitivity from an HTML code,
You can also use this link to find case ignoring code based on your jquery version, Make jQuery :contains Case-Insensitive
I had a similar problem with the following not working...
This works and without the need for an extension
This works too, but probably falls into the "manually looping" category....