why can't this code work ? I'm trying to change an image every 4 seconds... I really don't understand, everything should work correctly.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
function Falcon0408()
{
document.getElementByTagName('img');
if (document.getElementByTagName('img').src='img1.png')
{
document.getElementByTagName('img').src='img2.png';
}
else if (document.getElementByTagName('img').src='img2.png')
{
document.getElementByTagName('img').src='img3.png';
}
else if (document.getElementByTagName('img').src='img3')
{
document.getElementByTagName('img').src='img1.png';
}
}
</script>
</head>
<body>
<script>
setTimeout(Falcon0408(),400);
</script>
<img src='img.png'/>
</body>
</html>