<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
#demo{
width: 400px;
height: 200px;
margin: 100px auto;
background-color: pink;
}
</style>
<script type="text/javascript">
window.onload = function(){
function $(id){
return document.getElementById(id);
}
$(‘demo‘).onmouseover = function(){
demo.style.backgroundColor = ‘black‘;
}
}
</script>
</head>
<body>
<div id="box">
<div id="demo"></div>
</div>
</body>
</html>