<html >
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<script type="text/javascript">
function showaa(obj)
{
//var obj_parent=obj.parentNode;
var obj_parent=obj.parentElement
if(obj_parent.className=="aa_show")
{
obj_parent.className="aa_hide";
}
else
obj_parent.className="aa_show";
}
</script>
<style type="text/css">
.aa_show a.two
display:block;
.aa_hide a.two
display:none;
</style>
<body>
<div class="aa_hide">
<a href="#" onclick="showaa(this)">aaaa1</a><br/><!--用這個立馬就行了,真給氣死-->
<a href="javacript:showaa(this)">aaaa2</a><br/><!--今天下午一直用的這個一直不行,悲劇。知道原因的,求留言,非常感謝-->
</div>
</body>
</html>
說明:這種寫法相信各位童鞋看到的不多,我從一個實習的同僚那看到的,據說是他們老師教的。
各位客官如果有個人看法或者更好的寫法,請在下邊留言,必回複。可能回複的不太及時。