javascript(js)中使用this

来源:互联网 发布:最新机构网络投资理财 编辑:程序博客网 时间:2024/05/21 14:08

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
</head>

<body>

<script type="text/javascript">
function test(oo) {
oo.getElementsByTagName("a")[0].style.display='block';
//alert(oo.innerHTML);
//alert(oo.getElementsByTagName("a")[0].style.display=='none');
}
</script>
</head>
<body>
<li onMouseMove="test(this);" style="border:1px solid #ff0000; width:300px; ">aa<a href="#" style="display:none; ">xxx</a></li>
<li>aa<a href="#">xxx</a></li>
<li>aa<a href="#">xxx</a></li>
<li>aa<a href="#">xxx</a></li>
<li>aa<a href="#">xxx</a></li>
</body>
</html>