日期:2014-05-16 浏览次数:20469 次
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
</head>
<body>
<div id="test" style="border:1px solid red;">移动上来</div>
<script>
function $(el){
return typeof el == 'string' ? document.getElementById(el) : el;
}
$('test').onmouseover=function(){
this.style.border = '2px solid blue';
}
$('test').onmouseout = function(){
this.style.border = '2px solid red';
}
</script>
</body>
</html>
------解决方案--------------------
上面已有答案了。