1. Computing

Discuss in my forum

<input type="range">

By , About.com Guide

input type=range in Opera

input type=range in Opera

Screen shot by J Kyrnin

INPUT Range Description:

The range INPUT tag allows you to request a numerical value in your form where the exact number isn't important. Browsers that support it should display a slider for selecting the number. By using the min and max attributes, web developers can control the input. By default, the browser will display a range slider that sends values from 0 to 100.

DTD: HTML5: <!doctype html>

INPUT Range Web Browser Support:

At this time, only Opera 9+ and Safari 5+ support the INPUT range type with a slider (see screen shot above). All other browsers display a text box. You can still use this input type, you will just have to validate that the contents are a number with a script or CGI.

HTML Versions

INPUT Range Attributes:

Global attributes, event attributes, and the input tag attributes. Plus: </p>

  • autocomplete
  • list
  • max
  • min
  • step
  • valueAsNumber
  • selectedOption
  • stepDown()
  • stepUp()

INPUT Range Usage:

Standard range input tag

<form>
<input type="range">
</form>

See an example of a standard range input tag.

INPUT Range Special Notes:

The input range tag is only supported in Opera 9+ and Safari 5+ if you want a slider displayed, but you can still use this input type and validate that the submitted data is a number. That way, when other browsers do start supporting it, your forms won't have to be modified.

More INPUT Range Information:

  1. About.com
  2. Computing
  3. Web Design / HTML
  4. HTML and XHTML
  5. HTML 5
  6. HTML 5 Tags
  7. The INPUT Range Tag - INPUT Range - HTML Tag for Imprecise Numbers

©2013 About.com. All rights reserved.