Mr.Happy Mr.Happy - 1 year ago 64
Javascript Question

How to set jslider default pointers programmatically on page load

I am using jQuery Slider plugin script here is my HTML & JQuery code.


<div class="main">
<input id="slider" type="slider" name="price" value="20;50" />


from: 10,
to: 100,
step: 10,
round: 1,
skin: 'plastic',
limits: true,
onstatechange: function (value) {

Now my question is, I don't want to use range value inside as textbox value like below:

<input id="slider" type="slider" name="price" value="20;50" />

Is it possible to load 20;50 value with Jslider script?

My jsFiddle:

Any idea or suggestion?


Answer Source

Instead of calling the slider with


Try to call it like


This way you can remove the value attribute from the <input> tag and set the value programmatically before initiating the slider.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download