10.16 List Boxes

Next up is the list box control. List boxes are similar to pull-down menus, so we won’t have to start from scratch in describing them. They both enable the user to select an option from a list of options.

As you know, pull-down menus collapse after the user selects an option. With a list box, the list of options remains viewable after the user selects an option. For example, here’s what the dorms input control looks like implemented as a list box instead of a pull-down menu:

A drawback of a list box is that it takes up more space. So if you have lots of options, you should probably use a pull-down menu rather than a list ...

Get Web Programming with HTML5, CSS, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.