Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/04/2007, 09:45
Asyolath
 
Fecha de Ingreso: abril-2006
Mensajes: 80
Antigüedad: 18 años, 10 meses
Puntos: 2
Re: numeros extraidos de forma aleatoria

Prueba a usar esta función:

function aleatorio(datos) //datos es un array
{
var aleatorio= Math.round(Math.random()*(datos.length-1));
alert(datos[aleatorio]);
}

//Por ejemplo

var array1= new Array('a', 'b', 'c');
aleatorio(array1);

var array2= new Array('a', 'c', 'd', 'e');
aleatorio(array2);