JSFiddle - React, Tailwind, and code Playground
by sushanth009
HTML
<div id="seat0">
</div>
<input type="button" value="Move Left" id="btn" />
CSS
div
{
height: 100px;
width: 50px;
background-color: gold;
position: absolute;
left : 400px;
}
JavaScript
$(function() {
$('#btn').on('click', function() {
var i = 0;
var seat_xcoord = 3;
var leftValue = seat_xcoord * 20;
$('#seat' + i).css({
left: leftValue + 'px'
});
});
});