Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Foundations Selectors Basic Structural Pseudo-Classes

Create a interactive TOC

How can i create a TOC using html which opens and close interactively

I'm not going to give you the answer, but I'll give you some hints.

  1. You'll likely need to use a combination of jquery and css
  2. You want to store your content in some <div>'s, and have them be visible sometimes and not visible other times.
  3. With jquery, you can add css classes when an event happens, say onClick'ed

A quick Google search for "html5 toc" brought up this fantastic article from css-tricks