So.
First I used this <img onmouseover="preview.src=img1.src" id="img1" src="pic01.jpg" alt="Image Not Loaded"/>
but it didn't work. I changed 'id' to 'name' and it worked. But name attribute is obsolete and not recommended to use. So what should I use? I'm trying to make a image gallery for my school project. And because it's a school project it must be "perfect" html. No any errors.
And btw. 'id' worked in Internet Explorer and Mozilla Firefox. But not in Google Chrome.
My whole code is this:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="thumbnails">
<img onmouseover="preview.src=img1.src" name="img1" src="image001.jpg" alt="Image Not Loaded"/>
<img onmouseover="preview.src=img2.src" name="img2" src="image002.jpg" alt="Image Not Loaded"/>
</div>
<br>
<div class="preview" style="text-align: center;">
<img name="preview" src="image001.jpg" alt="No Image Loaded"/>
</div>
</body>
</html>
And this works in Google Chrome when I change id to name.