Skip to content

Commit 37b6a75

Browse files
committed
New-Button-Js
1 parent 6893a98 commit 37b6a75

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

DOM.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,32 @@ modebtn.addEventListener("click", () => {
5858
body.classList.add("light");
5959
body.classList.remove("dark");
6060
}
61-
});
61+
});
62+
63+
let newModebtn = document.querySelector(".button");
64+
newModebtn.addEventListener("click", () => {
65+
if (cmode === "light") {
66+
cmode = "dark";
67+
body.classList.add("dark");
68+
body.classList.remove("light");
69+
} else {
70+
cmode = "light";
71+
body.classList.add("light");
72+
body.classList.remove("dark");
73+
}
74+
});
75+
76+
let code = document.querySelector(".button-1");
77+
code.addEventListener("click", code_alert);
78+
function code_alert() {
79+
alert(`
80+
HTML:
81+
<div style="display: flex; justify-content: center; align-items: center; width: auto; ">
82+
<button class="button-1">
83+
<span class="bracket left">❴</span>
84+
<span class="text">Code</span>
85+
<span class="bracket right">❵</span>
86+
</button>
87+
</div>
88+
`);
89+
}

0 commit comments

Comments
 (0)