I am aware of the easier CSS options for my question, but I am determined to learn JS (Jquery), so please bear with me.
My plan: Menu-items are connected to articles within my content division. Initially, only the first article (#intro) is displayed. All the articles within the #menu should be in a JavaScript array. When I click on 'next' or 'previous', another article corresponding to the chronology of the menu items in the array should show up.
This is a preview of what I envision it to look like eventually (the bone structure): https://i.sstatic.net/72ybS.png
Please see my code below:
I'm new to JS and struggling to make the separate articles display. However, the initial function to hide everything works fine.
HTML code:
<!-- HTML code goes here -->
JS code:
<!-- JS code goes here -->
CSS Stylesheet:
<!-- CSS styles go here -->
If you could help me figure out what's wrong with my JS code, that would be greatly appreciated. My goal was to store all the menu items in a variable and use the 'next'/'previous' buttons to display the content accordingly.
EDIT
<!-- Updated JS code snippet will be shown here -->