JSFiddle - React, Tailwind, and code Playground
HTML
<input name="man-news">
<input name="milkMan">
<br>
<button id="insensitive">Case insensitive</button>
<button id="sensitive">Case sensitive</button>
JavaScript
$(document).ready(function(){
// This resets the background on every click first
$("button").click(function(){
$( "input[name*='man' i]" ).css("background-color", "white");
});
// Makes both inpute backgrounds black
$("#insensitive").click(function(){
$( "input[name*='man' i]" ).css("background-color", "black");
});
// Makes only man-news input black
$("#sensitive").click(function(){
$( "input[name*='man']" ).css("background-color", "black");
});
});