I'm having a hard time making the button responsible for generating the alert with the lucky number to start the javascript, I'm using the code below for the javascript:
<script type="text/javascript">
$('#btnGnrt').click(function() {
function sorteio_numero(nummin, nummax, numqtd){
var amostra = new Array(),
lista = new Array(),
tamanho = 0,
aleatorio = 0;
for(var i = nummin; i <= nummax; i++){
amostra.push(i);
}
while( lista.length < numqtd ){
tamanho = amostra.length;
aleatorio = Math.floor( Math.random() * tamanho );
lista.push( amostra.splice(aleatorio,1) );
}
return lista;
}
alert(sorteio_numero(1000,9999,1));
</script>
and the following to the button:
<div class="button">
<br><button id="btnGnrt">Gerar Sorteio</button><br>
</div>
The page contains only the button and a header with the title, I can not see the reason for the "not working" button