61,112
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
div{
width: 200px;
height: 200px;
font-size: 20px;
line-height: 200px;
text-align: center;
background: #000;
color: #eeeeee;
}
</style>
<script>
window.onload = function () {
var oBox = document.getElementById('box');
oBox.onclick = function () {
alert('你点击了按钮哦');
}
}
</script>
</head>
<body>
<div id="box">你好</div>
</body>
</html>