JSFiddle - React, Tailwind, and code Playground
HTML
<div class="score">0</div>
<div class="score">0</div>
CSS
div.score {
width: 32px;
height: 32px;
background-color: blue;
color: white;
text-align: center;
margin: 10px;
padding-top: 6px;
}
JavaScript
$('div.score').click(function() {
$this = $(this);
$this.hide('slide', { direction: 'right' }, 250, function() {
$this.show('slide', { direction: 'left' }, 250).text(parseInt($this.text(), 10) + 1);
});
});