This custom selector will match element attribute values, with case-insensitivity.
$.expr[':'].attrNoCase = function(node, stackIndex, properties){
var args = properties[3].split(',').map(function(arg) {
return arg.replace(/^\s*["']|["']\s*$/g, '');
});
if ($(node).attr(args[0])) {
return $(node).attr(args[0]).toLowerCase() == args[1].toLowerCase();
}
};
//Example Usage
$('div:attrNoCase(someAttribute,some value)');
$('div:attrNoCase("someAttribute","some value")');
I don't purposely capitalize mine either, but when matching attribute values that are input by the user, this is useful.