区域的显示与隐藏- object.style.display

 

 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>显示与隐藏</title>


<script type="text/javascript">
	function show() {
		var divNode = document.getElementById("addRider");
		if(divNode.style.display=="none") {
			divNode.style.display = "block";
		} else {
			divNode.style.display = "none";
		}
	}
</script>

</head>
<body>
	<a href="javascript:void(0)" onclick="show()">显示或隐藏</a>
	<div id="addRider" style="display: none">
		AAAAAAAAAA
	</div>
</body>
</html>

 

你可能感兴趣的:(display)