java学习1day

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>helloWorld</title>
    <style>
        div{
            text-align: center;
            font-size: 20px;
        }
    </style>
</head>
<body>
    <div id="hello">hello</div>
</body>
<script>
    var oDiv=document.getElementById('hello');
    oDiv.onclick=function(){
        alert('hello world!');
    }
</script>
</html>
posted @ 2020-01-04 16:30  Rosemajor  阅读(104)  评论(0编辑  收藏  举报