<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.a {
width: 100px;
height: 100px;
background: red;
margin: 20px auto;
}
</style>
</head>
<body>
<div class="a"></div>
<div class="a"></div>
<div class="a"></div>
<div class="a"></div>
<div class="a"></div>
<div class="a"></div>
<script>
var a = document.getElementsByClassName('a');
var i = 0;
for (i = 0; i < a.length; i++) {
a[i].onmouseover = function () {
a[i].style.height = '200px';
};
}
</script>
</body>
</html>