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:
parent
effd7feefc
commit
bd771947b8
|
@ -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>
|
||||
|
|
|
@ -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);
|
Loading…
Reference in New Issue