Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery Mobile Form Slider

jQuery Mobile Form Slider


jQuery Mobile Slider Control

A slider allows you to select a value from a range of numbers:

To create a slider, use the :

Example

  

  <

input type="range"

name="points" id="points" value="50" min="0" max="100">

Try it »

Use the following attributes to specify limits:

Tip: If you want to display the progress value in the button, you can add the data-show-value="true" attribute:

Example

data-show-value="true"

Try it »

Tip: If you want to show the progress on the sliding button (like a small popup), you can use the data-popup-enabled="true" attribute:

Example

data-popup-enabled="true"

Try it »

**Tip:** If you want to highlight the slider's value, add data-highlight="true":

Example

data-highlight="true"

Try it »


Flip switch

A flip switch is typically used for on/off or true/false buttons:

We can use the element and specify data-role as "flipswitch" to create a switch:

Example

  

   

Try it »

By default, the switch text is "On" and "Off". You can change it using the data-on-text and data-off-text attributes:

Example

data-on-text="True" data-off-text="False"

Try it »

**Tip:** The switch checkbox can use the "checked" attribute to set the default option:

Example

checked

Try it »


More examples

Range slider
Make a slider for a range of values.

Slider styles
Set styles for the slider switch.