Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KavyaC11 authored May 18, 2024
1 parent 2543dbd commit 3440538
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
function attachClickListener(toggleButton) {
console.log(toggleButton);
toggleButton.addEventListener("click", function () {
const contentBoxTemplate = document.getElementById("contentBoxTemplate");
if (contentBoxTemplate) {
const contentBox = document
.importNode(contentBoxTemplate.content, true)
.querySelector(".content-box");
this.parentNode.appendChild(contentBox);
if (
contentBox.style.display === "none" ||
contentBox.style.display === ""
) {
contentBox.style.display = "block";
console.log(contentBox.innerHTML);
console.log("IM on");
} else {
contentBox.style.display = "none";
console.log("IM off");
}
}
});
}

async function getFirstElementFromAPI(url) {
try {
let response = await fetch(url);
Expand Down

0 comments on commit 3440538

Please sign in to comment.