点击关闭 DIV 事件

版权声明:https://blog.csdn.net/lovexiuwei https://blog.csdn.net/lovexiuwei/article/details/82667400
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>关闭DIV</title>
		<style type="text/css">
			.button-close{
				cursor: pointer;
			}
		</style>
	</head>
	<body>
		<div id="close" style="width: 477px; height: 477px; background-color: #ADADAD;">
			<button class="button-close" onclick="javascript:turnoff('close')" title="关闭div">点击关闭</button>
		</div>
	</body>
	<script>
		function turnoff(obj){
	          document.getElementById(obj).style.display="none";
		}
	</script>
</html>

猜你喜欢

转载自blog.csdn.net/lovexiuwei/article/details/82667400
今日推荐