The Slider API helps you control the functionality of the component through a set of handy methods.
// disable a slider on a page slider.disable(); // make the slider active again slider.enable();
To check if a slider is disabled, call the isDisabled() method:
slider.isDisabled(); // -> true/false
While a user sets the value of a slider by dragging the thumb to the desired position, you can set the value from the code via the setValue() method:
You can get the current value of Slider with the help of the getValue() method.
var value = slider.getValue(); // ->  // for a range slider as an array var value = slider.getValue(); // -> [20,50]
In case you've set the value of Slider as an array where the first number is greater than the second one, e.g. [50,20], getValue() will return the value as an array with numbers in the ascending order, that is [20,50].
Back to top
// sets value as an array (the first number is greater than the second one) slider.setValue([50,20]); // returns an array of numbers (the numbers are ascending) var value = slider.getValue(); // -> [20,50]