No funciona "window.onload"
Publicado por ATC (2 intervenciones) el 09/06/2021 05:31:14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
<script>
var imagen;
function tipoflor(){
alert ("Hortensia (Myosotidium hortensium)");
}
function daTipoFlor(){
imagen=document.getElementsByTagName("img")[0];
imagen.addEventListener("click",tipoflor,false);
imagen.addEventListener("mouseover",crecer,false);
imagen.addEventListener("mouseout",menguar,false);
}
function crecer(){
imagen.width=225;
imagen.height=225;
}
function menguar(){
imagen.width=200;
imagen.height=200;
}
window.onload=daTipoFlor;
</script>
</head>
<body>
<p><img src="Imagenes/1.jpg" alt="flor"></p>
</body>
</html>
Valora esta pregunta


0