<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js动画</title>
<style>
div{width:100px;height:100px;background-color:lightblue;}
</style>
</head>
<body>
<div></div>
<script>
var div = document.getElementsByTagName('div')[0];
div.onmouseover = function()
{
this.style.width = '500px';
this.style.height = '500px';
}
div.onmouseout = function()
{
this.style.width = '100px';
this.style.height = '100px';
}
</script>
</body>
</html>