Working with Lists

A list displays a number of options from which the visitor can choose, as in Figure 68.5. Lists are better than radio buttons or checkboxes if the number of options is rather large, since lists make better use of space.

The size attribute of the list's select tag determines how many options are visible at once. If the list contains more options than this number, the browser adds a scrollbar to the right side of the list.

Listing 68.6. View Source for Figure 68.6.
 <form> <table> <tr> <td>Select the newsletter you would like to receive:</td> </tr> <tr> <td><select name="newsletterList" size="5"> <option value="news">News</option> <option value="sports">Sports</option> <option value="business">Business</option> <option value="entertainment">Entertainment</option> ...

Get Web Design Garage 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.