I want to know how can I select first,second,third,etc. link from nav. So that I can add onclick event function that changes appearance of Div. Also I have goTo links like index.html#div1. The idea is to click link and the link to navigates us to the div and change it appearance(## Heading ## box-shadow or change background color ), but temporary. You can check some code over here: "https://jsfiddle.net/malle/gwq924fu/1/"
Have you tried using the JavaScript querySelectorAll() for the links?
You could use something like:
const links = document.querySelectorAll("a");
And to modify its CSS:
links[0].style.backgroundColor = "red";
But all the a elements should have the onClick defined to your function, so you could use if statements to validate what element you would like to modify.