JSFiddle - React, Tailwind, and code Playground
HTML
<div id="one"></div>
<div id="two"></div>
CSS
#one, #two {
min-width : 100px;
max-width : 30px;
height: 20px;
}
#one {
background : blue;
}
#two {
background : green;
}
JavaScript
$(function () {
$('#one').width('50px').on('click', function () {
alert('This div was set in JS to: 50px\nCurrent Width: ' +$(this).width() + 'px');
});
$('#two').width('150px').on('click', function () {
alert('This div was set in JS to: 150px\nCurrent Width: ' +$(this).width() + 'px');
});
});