<script> src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
CSS
.block{
width:100px;height:100px;float:left;
margin:20px;border:1px solid red;
}
span{
color:red;
}
JS
$(document).ready(function(){
var renkler = ["yellow", "red", "blue","green"];
var sayi;
$("#Roll").click(function(){
var saniye=3;
var spin=1;
setInterval(function(){
$("span").text("");
saniye--;
if(saniye==0){
$("span").text("Çevrildi");
}else if(saniye>=0){
$("span").text(saniye);
}
},1000);
setTimeout(function(){
if(spin==1){
spin--;
for(var i=1;i<=3;i++){
sayi=Math.floor(Math.random() * 4);
$("#b"+i).css("background-color",renkler[sayi]);
}
}
},3100);
});
});