Can any body shed some light on why I am not able to stop and start this loop?
<input type="button" value="start" onclick="start()">
<input type="reset" value="stop" onClick="stop()">
var startLottery = false;
while(startLottery){
setInterval(function(){automateLottery()},120);
startLottery;
};
var start = function(){
startLottery = true;
};
var stop = function(){
startLottery = false;
};
Thank you
startLotteryin the loop? It'll just evaluate a boolean and do nothing with it.