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>
|
</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>
|
||||||
|
|
|
@ -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);
|
Loading…
Reference in New Issue