code refactoring

adjust length of script tag in index.html
rename note variable to readThis to better
reflect the element it is used for
This commit is contained in:
emma 2025-02-05 15:07:15 -05:00
parent effd7feefc
commit bd771947b8
2 changed files with 8 additions and 6 deletions

View File

@ -52,7 +52,9 @@
>
</div>
</section>
<script src="https://kit.fontawesome.com/821c138f8d.js" crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/821c138f8d.js"
crossorigin="anonymous">
</script>
<script src="/js/script.js" defer></script>
<footer>
<p>happy valentine's day!</p>

View File

@ -39,10 +39,10 @@ const main = () => {
transHeart.style.cursor = "pointer";
transHeart.addEventListener("click", extraLove);
const note = document.querySelector(".read-this");
note.style.cursor = "default";
note.removeEventListener("click", main);
const readThis = document.querySelector(".read-this");
readThis.style.cursor = "default";
readThis.removeEventListener("click", main);
};
const note = document.querySelector(".read-this");
note.addEventListener("click", main);
const readThis = document.querySelector(".read-this");
readThis.addEventListener("click", main);