|
@@ -1,12 +1,45 @@
|
|
<!DOCTYPE html>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<html lang="en">
|
|
|
|
+
|
|
<head>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
<title>Document</title>
|
|
|
|
+ <style>
|
|
|
|
+ #div1 {
|
|
|
|
+ width: 200px;
|
|
|
|
+ height: 200px;
|
|
|
|
+ background: red;
|
|
|
|
+ top: 200px;
|
|
|
|
+ left: 100px;
|
|
|
|
+ position: absolute
|
|
|
|
+ }
|
|
|
|
+ </style>
|
|
|
|
+ <script>
|
|
|
|
+
|
|
|
|
+ //等页面所有的东西全部加载完毕,执行里面的内容
|
|
|
|
+ // window.onload = function () {
|
|
|
|
+ // var btn = document.getElementById('btn')
|
|
|
|
+ // console.log(btn)
|
|
|
|
+ // }
|
|
|
|
+ </script>
|
|
</head>
|
|
</head>
|
|
|
|
+
|
|
<body>
|
|
<body>
|
|
-
|
|
|
|
|
|
+ <button id="btn">点击</button>
|
|
|
|
+ <div id="div1">
|
|
|
|
+ </div>
|
|
|
|
+ <script>
|
|
|
|
+ var btn = document.getElementById('btn')
|
|
|
|
+ console.log(btn)
|
|
|
|
+ // var div1 = document.getElementById('div1')
|
|
|
|
+ // btn.onclick = function(){
|
|
|
|
+ // div1.style.background = 'blue'
|
|
|
|
+ // div1.style.top = '400px'
|
|
|
|
+ // div1.style.left = '250px'
|
|
|
|
+ // }
|
|
|
|
+ </script>
|
|
</body>
|
|
</body>
|
|
|
|
+
|
|
</html>
|
|
</html>
|