Skip to content

How to set default value for jQuery UI Slider

The jQuery UI slider has option named “value”, which can be used to set the value of the slider.

	
//Code Starts
​$(document).ready(function()
{ 
   var iValue = 18;
   $("#lbl").text(iValue);
   $("#slider").slider(
   {
     min:0,
     max:100,
     value:iValue,
     slide:function(event,ui)
     {
       $("#lbl").text(ui.value);
     }
  });
});​
//Code Ends

Leave a Reply

Your email address will not be published.