Entering a Value from a Range of Values

If you want to display a slider, then you can create an <input type="range" /> element. For example, the following HTML form displays a slider that enables you to select a quantity of candy to buy:

<label>    Quantity of Candy:    <input id="quantity"        type="range"        min="10"        max="100"        step="5"        value="30"/></label>

The slider displays a range of values between 10 and 100 with 5-unit increments. The default value is set to 30 (see Figure 5.8).

Image

FIGURE 5.8 Displaying a slider

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed 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.