<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.wrap {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
}
img {
display: inline-block;
width: 74px;
height: 115px;
}
</style>
</head>
<body>
<div class="wrap">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
<img src="./img/dark.jpg" alt="">
</div>
<script>
var oImg = document.getElementsByTagName("img");
for (var i = 0; i < oImg.length; i++) {
oImg[i].tag = true;
oImg[i].onmouseover = function () {
console.log(this.tag)
if (this.tag) {
this.src = "./img/bright.jpg";
this.tag = false;
} else {
this.src = "./img/dark.jpg";
this.tag = true;
}
}
}
</script>
</body>
</html>