JSFiddle - React, Tailwind, and code Playground

by alexdickson

HTML

<input value="search" />

<input value="Search" />

<input value="SEARCH" />

<input value="dont-pick-me" />

JavaScript

$.expr[':'].attrCaseInsensitive = function(node, stackIndex, properties){
    var args = properties[3].split(',').map(function(arg) {
        return arg.replace(/^\s*["']|["']\s*$/g, '');  
    });
    return $(node).attr(args[0]).toLowerCase() == args[1];
};

$('input:attrCaseInsensitive(value, "search")').css('border', '1px solid red');