javascript - Make .find non case sensitive -


i can using:

$results.find('a[href$=".doc"]') 

to find ending .doc editing reasons. however, seems case sensitive, i.e. if document ends .doc or .doc, not find those. possible make non case sensitive?

you have create function match case insensitively.

$results.find('a').filter(function(){return /\.doc$/i.test(this.href);}); 

it possible enumerate 8 cases in selector, won't scale easily.

$results.find('a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"],a[href$=".doc"]') 

Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -