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
Post a Comment