Jquery :contains and making it Case-Insensitive
Well, playing around with jQuery, I once came accross jquery contains(). Very handy selector and easy to use and I have been using this in most of my scripts. So what does :contains do.. jQuery( ":contains(text)" ); Jquery contains selects all elements that contains the specified text. As the doc say, it selects all the elements which contains the given text. the elements can appear directly within the selected element, in any of that element's descendants, or a combination thereof. Example jQuery Javascript PHP JQUERY try it in fiddle The above script, will change the color of "Javascript" and "JQUERY". however, if you notice, the color of "jQuery" is not changed, though it starts with `J`. thus, :contains is case sensitive. The text must have matching case to be selected. What is you need contains with Case-Insensitive. One way to do this is , extending the old :contains selector. // OVERWRITES old selecor ...