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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -