Hey having a little trouble jquery and the hmtl5 range. I\'m try to get the values as they changed but the event listener is not capturing it. Currently my code is:
HTML
I assume your span has an id: ...
Lets also assume that you have a few sliders, and you want to see a text change if any of them were moved:
-
Apply Credits1:
-
Apply Credits2:
50
Try this:
$(document).ready(function(){
$("[type=range]").change(function(){
var newval=$(this).val();
$("#slidernumber").text(newval);
});
});
http://jsfiddle.net/MahshidZeinaly/CgQ5c/
Now lets assume that you have a few sliders, but you want to see a text change if a particular one of them were moved. (I assume it because the range input is inside li tag, and you gave it a name):
-
Apply Credits1:
50
-
Apply Credits2:
50
Try this:
$(document).ready(function(){
$("[type=range]").change(function(){
var newv=$(this).val();
$(this).next().text(newv);
});
});
http://jsfiddle.net/MahshidZeinaly/2pe7P/1/