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

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

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

jtree - comparing two TreeNode (or DefaultMutableTreeNode) objects in Java Comparator -