Is it possible to control the number of runs of setInterval
? I made a very simple script where I wanted to div
blink 3x to alert the user. But in the script I did it it blinks straight.
<div id="my-div">alerta teste</div>
setInterval(function(){
$('#my-div').animate({'opacity':'toggle'})
},250);