I would like to know how I do so that javascript executes the following but without the need for the button, which is automatic when I open the page
<!DOCTYPE>
<html>
<head>
<SCRIPT language=JavaScript>
function ejemplo2()
{
document.write('<td rowspan=2>');
var num = Math.random();
var imagen = Math.floor(Math.random() * 2);
var nombre = "C:/Users/Vivi/Downloads/TAROT/fondo/imagenes/"+imagen+".png";
var texto = texto_aleatorio[imagen]();
document.write("<IMG NAME=portada SRC="+nombre+" width=280 height=450 BORDER=2>");
document.write(' ');
document.write('</td>');
}
var texto_aleatorio = [];
texto_aleatorio[0] = function() {
var textos = new Array();
textos[0] = "Tenemos los mejores productos del mercado, con controles de calidad intensivos.";
textos[1] = "Distribuimos en todo el mundo con los mejores tiempos de entrega y fiabilidad de los envíos.";
textos[2] = "No tenemos competidores que nos hagan sombra. Contrate con nosotros y compuébelo. Así de fácil.";
textos[3] = "Disponga del mejor servicio de atención al cliente y una respuesta rápida a sus problemas.";
var aleat = Math.random() * (textos.length);
aleat = Math.floor(aleat);
document.write(textos[aleat])
}
texto_aleatorio[1] = function(){
var textos = new Array();
textos[0] = " mejores productos del mercado, con controles de calidad intensivos.";
textos[1] = " en todo el mundo con los mejores tiempos de entrega y fiabilidad de los envíos.";
textos[2] = " competidores que nos hagan sombra. Contrate con nosotros y compuébelo. Así de fácil.";
textos[3] = " del mejor servicio de atención al cliente y una respuesta rápida a sus problemas.";
var aleat = Math.random() * (textos.length);
aleat = Math.floor(aleat);
document.write(textos[aleat])
}
</SCRIPT>
</head>
<body>
<button onclick=ejemplo2() value="empezar">empezar</button>
</body>
</html>