JSFiddle - React, Tailwind, and code Playground
by lshettyl
HTML
<button id="grid1_createBtn">Create</button>
<button id="grid1_updateBtn">Update</button>
<button id="grid2_createBtn">Create</button>
<button id="some_Btn">No match</button>
<button id="grid2_create">No match</button>
JavaScript
$('button[id^="grid"][id$="Btn"]').css({
color: 'red'
});