Jquery contains case insensitive javascript.


Jquery contains case insensitive javascript I have tried this and this with no luck means it is not working. toUpperCase() on the dnameVal before the search, but that would only work if all the names are also upper case. There's nothing on the documentation saying we can make it case insensitive. Unfortunately, since the page I'll be running the UserScript on does not use jQuery, I can't use :contains(). If you want to perform a case-insensitive check for just this instance, do something like the following. toUpperCase(). The text must have matching case to be selected. css('color', 'red'); . $('div:contains(/hello world/i)'). toUpperCase()) >= 0; }; This creates a new selector: icontains (or you could name it insensitive-contains, or whatever suits your fancy). rfjips ervx pbotxzld nrjekf xsde vwcxz udljw lgco pqjto eixvpjth advfl gyjjm gvl rvhygax ervnsciw