Quelltext:
<html>
<head><title>Test</title>
<style type="text/css">
img { position:absolute; }
</style>
<script type="text/javascript">
var a = 0;
var b = 0;
var i = 1;
function down() {
a++;
b++;
document.getElementsByTagName("img").style.left = a + "px";
document.getElementsByTagName("img").style.top = b + "px";
i++;
if (i >= 200) {
window.clearInterval(moving);
}
moving = window.setInterval("down()", 10);
}
</script>
</head>
<body bgcolor="blue" onload="runter()"><img src="sonne.bmp">
</body></html>
Fehlermeldung:
Fehler: document.getElementsByTagName("img").style has no properties
Zeile: 14
so natürlich