JSFiddle - React, Tailwind, and code Playground
HTML
<div id="d"></div>
<button id="per">100%</button>
<button id="px">100px</button>
CSS
#d {
height: 50px;
width: 100px;
background: #f00;
}
JavaScript
$('#per').click(function(){
$('#d').css('width', 100 + '%')
})
$('#px').click(function(){
$('#d').css('width', 100)
})