0

To preface: I'm a total JavaScript beginner, so I could be missing something basic here.

I'm trying to make it so that only the tab that is clicked is highlighted the correct color, and all other buttons are returned to the original state when clicked. When I try to remove the class, however, I get this: Uncaught TypeError: Cannot read property 'getElementByClassName' of undefined. Here's my javascript:

    function functionSelectICE() {
  document.document.getElementByClassName("navMainItem").classList.remove("navMainHighlight");
}

The rest of the code: https://codepen.io/Smoke3785/pen/QWyqBOB

eric
  • 11
  • 2

1 Answers1

0

Its document.getElementsByClassName not getElementByClassName

Refer documentation for getElementsByClassName

Akhil
  • 1,403
  • 7
  • 19