title: Remove class name from nodeList when clicked on any node from the same nodeList
body: <p>i'm fairly new to javascript programming and i want to learn it more. I want to remove a class name from every node of a nodeList when i click on any node from the same nodeList.</p>
  
  <p>I wrote this code:</p>
  
  <pre><code>d = document.querySelectorAll(".chat-line__message");
  d.forEach(removeHighlight);
  
  function removeHighlight(item){
    item.addEventListener("click", function(){
      item.forEach(function(element){
          element.classList.remove("highlight");
      });
      //for-loop instead of forEach doesn't work either.
  
    })
  
  }
  </code></pre>
  
  <p>What am i doing wrong? Thank you.</p>