复制下面代码存为HTML文件测试<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<input type="button" id="btn" onmouseover="popdiv()" value="划过我" />
</body>
</html>
<script>
var flag=true;
function popdiv()
{

if(flag)
{
var obj=document.createElement("div");
obj.setAttribute("id","pop");
obj.style.zIndex="999";
obj.style.width="300";
obj.style.height="150";
obj.style.border="1px solid #000000"
obj.style.backgroundColor="#cccccc"
obj.style.filter = "alpha(opacity=80)";
obj.style.textAlign="center"
obj.style.paddingTop="100";
obj.innerHTML="<a href='http://www.csdn.com' target='_blank' id='ahr' onclick='cleanDiv()'>www.csdn.com</a>";
document.body.appendChild(obj);
flag=false;
}

}
function cleanDiv()
{
//清除节点
elem=document.getElementById("pop");
elem.parentNode.removeChild(elem);
flag=true;

}</script>