|
@@ -0,0 +1,20 @@
|
|
|
+var btn = document.getElementById("btn");
|
|
|
+var box = document.querySelector(".box");
|
|
|
+console.log(box);
|
|
|
+btn.onclick = function() {
|
|
|
+ box.style.background = 'red';
|
|
|
+ box.style.left = 200 + 'px';
|
|
|
+}
|
|
|
+// var a = document.getElementById("a");
|
|
|
+var b = document.getElementById("b");
|
|
|
+var c = document.getElementById("c");
|
|
|
+var d = document.getElementById("d");
|
|
|
+
|
|
|
+var a = document.querySelector(".list #a");
|
|
|
+var changeBtn = document.querySelector(".changeBtn");
|
|
|
+changeBtn.onclick = function() {
|
|
|
+ a.style.background = 'red';
|
|
|
+ b.style.background = 'yellow';
|
|
|
+ c.style.background = 'blue';
|
|
|
+ d.style.background = 'green';
|
|
|
+}
|