I need to make a draw system that appears one number at a time but there are eight numbers that should appear next to each other more than just turning from 1 to 9 equal this code and in the time interval go one stopping at a time ! Same as mega sena!
<script type="text/javascript">
var nomes = ["1","2","3","4","5","7","8","9",];
function sorteio() {
var c = document.getElementById('campo');
var i = 0;
var velocidade = document.getElementById('speed').value;
var tempo = document.getElementById('time').value;
var intervalo = window.setInterval(function() {
if (i >= nomes.length)
i = 0;
c.value = nomes[i++];
}, velocidade);
window.setTimeout(function() {
clearInterval(intervalo);
var n = Math.floor(Math.random()*nomes.length);
c.value = nomes[n];
}, tempo);
}
</script>
<input type="text" id="campo" name="campo" placeholder="Boa sorte a todos!" readonly="true">
<input type="hidden" value="100" id="speed" name="speed"><br>
<input type="hidden" value="600" id="time" name="time">
<input type="button" onclick="sorteio();" value="Sortear o Ganhador" id="btn" name="btn">