JSFiddle - React, Tailwind, and code Playground
HTML
<div id="bullet1">
<span></span>
<span></span>
<span></span>
</div>
CSS
span{background:red; height:50px; width:50px; float:left; margin:10px;}
JavaScript
$(document).ready(function () {
function shuffle() {
var rnd = Math.floor((Math.random()*3));
$('#bullet1').children().eq(rnd).addClass('current');
};
shuffle();
$('#bullet1 span').click(function (e) {
if($(e.target).hasClass('current')) {
alert('You win. Reshuflling.');
}else {
alert('Sorry Try Again. Reshuffling');
}
$('#bullet1 span').removeClass('current');
shuffle();
})
});