I am trying to select a li by its second class. I've tried a bunch of different things but I'm new to javascript and nothing is working for me. This is my code at the moment.
HTML
<li class="nav-links" id="doing">doing</li>
<li class="nav-links active" id="being">being</li>
<li class="nav-links" id="done">done</li>
Javascript
var active = document.querySelector("nav-links active");
var initialInner = e.innerHTML;
e.innerHTML = active.innerHTML;
active.innerHTML = initialInner;
Thank you in advance for taking the time to help
Edit: The code works when I change active class to an id and use getelementbyid. Is there possibly a difference between queryselector and getelementbyid that could be causing the code to not run?