我真是搞不懂怎么会出错,对JS深深的绝望
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
#div1{width:200px;height:200px;background: yellow;border:5px red solid;
.red{width:400px;height:400px;background: red;}
</style>
<script>
window.onload=function(){
var odiv=document.getElementById("div1");
odiv.onmouseover=function(){
this.className='red'
}
odiv.onmouseout=function(){
this.display=''
}
}
</script>
</head>
<body>
<div id="div1"></div>
</body>
</html>
慕码人8056858
相关分类