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> </div>
</section> </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> <script src="/js/script.js" defer></script>
<footer> <footer>
<p>happy valentine's day!</p> <p>happy valentine's day!</p>

View File

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