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

JavaScript jQuery Basics (2014) Creating a Mobile Drop Down Menu Perform: Part 2

I finally realized ONE of the things that held me up in this lesson. The select menu is NOT made for NAVIGATION.

It was always in the back of my mind. I learned the select menu. I don't recall it being mentioned that it could be used for navigation OR that apparently it needs tweaking from js to make it happen. It finally sank in when I made an html select nav, put it in the page and VIOLLA! nothing happens. So then, what is the mechanism that makes a select menu navigate?

<select>
  <option value="index.html">Home</option>
  <option value="about.html">about</option>
  <option value="contact.html">contact</option>
  <option value="support.html">support</option>
    <option value="faqs.html">faqs</option>
  <option value="events.html">events</option>
</select>

1 Answer

Steven Parker
Steven Parker
229,786 Points

You're right, the <select> element is simply for choosing an option.

:point_right: The functionality of navigation is implemented in the JavaScript.

In the Perform: Part 2 video, the event handler for the "Go" button retrieves the chosen value and uses it to redirect the window location. You can see that starting around time index 2:08.

Thanks Steven, handler for the go button...I'll be looking for that. Let me ask you this (cause I love your insight)...Would you personally use a drop down nav like this? Cause I kinda feel like Andrew just uses this as a way for us to practice skills.