我试图隐藏一个 div,但我似乎无法让它正常工作。这是我的代码:
<head>
<title>Home - Chrome</title>
<link rel="stylesheet" href="main.css">
<script src="jquery.js"></script>
<script>
function 1Hide() {
document.getElementById('div1').style.display = 'none';
}
</script>
</head>
<body>
<div id="div1">
</div>
<a onclick="1Hide" href="javascript:void(0);">Click</a>
</body>
CSS:
#div1 {
height: 100;
width: 700;
margin: 30 auto 0 auto;
background: #FFFFFF;
}