JSFiddle - React, Tailwind, and code Playground
HTML
<input name="myName" id="myId1" type="button" class="fixedWidth" value="blablablablabla" />
<input name="myName" id="myId2" type="button" class="fixedWidth" value="blablablfsqdfqsdf qsdf sdablabla" />
<br><br><br>
<input name="Act" id="Action" type="button" value="Action" />
JavaScript
$(function(){
$('.fixedWidth').each( function(){
$(this).css('width', $(this).width());
console.log($(this).width())
})
})
$("#Action").click(function () {
$("[id^='myId']").val( "ok" );
});