I am trying to get the selected value from the Ion Range slider outside the function. But the value I am getting is undefined. I used the Ion range Slider Plugin with the following code.
function getValue()
{
$(".range-slider").ionRangeSlider({
// type: "single",
min: 80,
max: 100,
grid: true,
onFinish: function (data) {
// Called every time handle position is Finished
var value = data.from;
return value;
// console.log("Confidence: ",confidence);
}
});
}
getValue();
console.log("Value", getValue());
I can't figure out how can I get the range selected value outside the function. Here is the fiddle that I have tried: https://jsfiddle.net/georgoboy/kxcmagjw/1/