Book Image

HTML5 Multimedia Development Cookbook

Book Image

HTML5 Multimedia Development Cookbook

Overview of this book

HTML5 is the most significant new advancement the web has seen in many years. HTML5 adds many new features including the video, audio, and canvas elements, as well as the integration of SVG. This cookbook is packed full of recipes that will help you harness HTML5’s next generation multimedia features. HTML5 is the future.Whether you’re a seasoned pro or a total newbie, this book gives you the recipes that will serve as your practical guide to creating semantically rich websites and apps using HTML5. Get ready to perform a quantum leap harnessing HTML5 to create powerful, real world applications. Many of the new key features of HTML5 are covered, with self-contained practical recipes for each topic. Forget hello world. These are practical recipes you can utilize straight away to create immersive, interactive multimedia applications. Create a stylish promo page in HTML5. Use SVG to replace text dynamically. Use CSS3 to control background size and appearance. Use the Canvas to process images dynamically. Apply custom playback controls to your video.
Table of Contents (16 chapters)
HTML5 Multimedia Development Cookbook
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Using the range tag


HTML5 now allows us to create a whole new kind of input. The range tag creates a slider control, allowing the user to choose among a range of values. This used to be difficult, but not anymore! Check it out!

How to do it...

Interestingly, we can use virtually the same code as we did in the number example, but change the input type to "range". Here's how to do it:

<form>
<label>How many shoes would you like to purchase?<label>
<input type="range" name="quantity" min="2" max="6" step="2" value="2" />
</form>

Notice we can use the same optional min, max, step, value, and size attributes.

How it works...

Specifying <input type="range"> will display the new form control with a slider, allowing the user to increase and decrease the value in the field:

There's more...

There are certainly plenty of other uses for the <input type="range"> tag well beyond e-commerce. In fact, since we can't see the currently selected value, shopping probably...