Levent Tulun
Levent Tulun

Reputation: 711

Bootstrap slider no such method 'getValue'

JS:

 // Basic Slider: Success
jQuery('#slider-success').slider({
  range: "min",
  max: 100,
  value: 60
}).on('slide', function(ev) {
    console.log($('#slider-success').slider('getValue'));
});

HTML:

<div id="slider-success" class="slider-success mb20"></div>

I am trying to get value when the slider change dynamically. But i got an error :

Uncaught Error: no such method 'getValue' for slider widget instance

Upvotes: 2

Views: 909

Answers (3)

Vlad
Vlad

Reputation: 31

$('#slider-success').val() is more convenient.

Upvotes: 0

Anton Gusar
Anton Gusar

Reputation: 503

Try to take the value from data object

$('#slider-success').data('slider').getValue()

Example with your code - http://jsfiddle.net/Z6CyV/66/

Upvotes: 2

Amar Singh
Amar Singh

Reputation: 5622

Simply use

$('#slider-success').val();

OR

$('#slider-success').text();

Upvotes: 0

Related Questions