Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1.03 KB

README.md

File metadata and controls

26 lines (18 loc) · 1.03 KB

JavaScript Accordion

A basic JavaScript and HTML accordion.

Coding from Scratch

When coding something like a JavaScript accordion, half of the problem is how to split the lager objective into small steps. Download a copy of the index.html and accordionjs files and then follow these steps. Do not proceed to the next step until the current one is done and tested.

  1. Use CSS to hide all sections of content.
  2. Add a click event to the section titles. For now console.log() the word "open".
  3. Function needs to know which section was clicked. Use console.log() to confirm.
  4. On click, make the content below the link visible.
  5. Use an if statement to hide or display the content.
  6. Hide all other accordion content before displaying the new content.

Repo Resources