O'Reilly logo

Essential JavaScript™ for Web Professionals, Second Edition by Dan Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Project I: JavaScript and Pull-Down Menus—Getting to Where You Want to Go!

The first thing we need to do is insert the HTML code into the secondary navigation that will give us our pull-down menu and Go button. Here is the code that we will use.

<select name="PullDown">
     <option value=" ">Get There Quick
     <option value=" ">What's New
     <option value=" ">Featured Product
     <option value=" ">Press Releases
     <option value=" ">Company Store
</select>
<input type="button" name="Go" value="Go">

Because we will be inserting the pull-down into a preexisting design, we will place the <FORM> tag, which will be named NavForm, at the beginning and end of the HTML body instead of directly around the form element to prevent any unwanted line breaks or spaces. You ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required