Well I'm doing a page that makes sweepstakes, I already managed to do half the work, but when I show the result of the vector it goes to another page, I wanted to know how to be able to show what's in the vector on the same page.
My html
<!DOCTYPE html>
<html>
<head>
<title>Gerador</title>
<link rel="stylesheet" type="text/css" href="estilo.css">
<script src="interacao.js"></script>
<meta charset="utf-8">
</head>
<body>
<h1 id="principal">Gerador de apostas</h1>
<hgroup id="menu">
<a href="file:///D:/Programa%C3%A7%C3%A3o/Gerador%20de%20apostas/index.html"><p>Inicio</p></a>
<a href="file:///D:/Programa%C3%A7%C3%A3o/Gerador%20de%20apostas/gerador.html"><p>Gerador</p></a>
<a href="file:///D:/Programa%C3%A7%C3%A3o/Gerador%20de%20apostas/sobre.html"><p>Sobre</p></a>
</hgroup>
<hgroup id="apostas">
<button onclick="mega()">Mega-Sena</button>
<button onclick="lotofacil()">Quina</button>
<button onclick="quina()">Lotomania</button>
<button onclick="lotomania()">LotoFácil</button>
</hgroup>
My javascript
function mega(void) {
var numeros = [];
var numero,verifica;
for(var i=0;i<6;i++)
{
do
{
numero = Math.floor(Math.random()*61);
verifica = false;
for(var j=0; j < i;j++)
{
if (numeros[j]==numero) {
verifica=true;
}
}
}while(verifica);
numeros.push(numero);
}
for(var i=0;i<6;i++)
{
document.write(numeros[i]);
}
}