You are using document.getElementsByClassName… Use document.querySelector instead. EXAMPLE: const Home = document.querySelector(“.Home”);
You use document.getElementById… Which is great! You can use that if you would like to control the link properties later. However, you do not need to define the links for functions. the “onclick” tags inside the “li” handle that.
Comments 1
Heyy, I gotchu.
You are using document.getElementsByClassName… Use document.querySelector instead. EXAMPLE: const Home = document.querySelector(“.Home”); You use document.getElementById… Which is great! You can use that if you would like to control the link properties later. However, you do not need to define the links for functions. the “onclick” tags inside the “li” handle that.Sign in to join the conversation.