<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>点击将DIV变成红色</title>
<style>
body{font:12px/1.5 Tahoma;text-align:center;}
code,input,button{font-family:inherit;}
#tips{border: 1px solid red;width: 300px;height: 20px;margin: 0 auto;display: none;}
</style>
<script>
window.onload = function(){
// var oDiv = document.getElementById("div");
var oP = document.getElementsByTagName("p")[0];
var oTips = document.getElementById("tips");
oP.onmousemove = function(){
oTips.style.display = "block";
};
oP.onmouseout = function(){
oTips.style.display = "none";
};
};
</script>
</head>
<body>
<div id="div">
<p><input type="checkbox"/>两周内自动登录</p>
</div>
<div id="tips">为了您的信息安全,请您不要在公共电脑上使用此功能!</div>
</body>
</html>