I agree that a filter function is probably the way to go, but a
regular expression within it might be more flexible:
$('something').filter(function() {
return (/value/i).test( $(this).attr('attribute'));
});
substitute your own value and attribute for the placeholders, of course.
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On May 21, 2008, at 3:34 PM, Scott Sauyet wrote:
Rafael Soares wrote:
I'm using a [attribute*='value'] selector, and the only problem is
that I need it to be case insensitive.
I don't think there is any simple way, but a filter function should
do what you need.
http://docs.jquery.com/Traversing/filter#fn
I might have this off a bit, but something like this, I think would
do it:
var target = myValue.toLowerCase()
$("#container *").filter(function(index) {
var attr = $(this).attr(myAttribute);
return !attr || attr.toLowerCase().indexOf(target) == -1;
}).doSomething();
Cheers,
-- Scott