Skip to content
Advertisement

Tab selection without jQuery

I have a function in jQuery to switch tabs and as it the only one using jQuery, I want to convert it to JS only. After hours of trying (still learning) and feeling miserable to fail at this trivial thing, I humbly ask for help.

JavaScript
JavaScript
JavaScript

I was about here when I gave up, my forEach/event listener won’t even work and I don’t know even why, any help/explanation appreciated.

JavaScript

Advertisement

Answer

I believe the element listener is not being called, try adding a “.” in front of the selector names as follows. I reckon it does not know what the element is.

JavaScript

and

JavaScript

Hope this helps!

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement