javascript - Is it possible to change the min and max of a HTML5 range slider according to the input of another form? -
refer this: http://www.alainbruno.nl/form.html
so, instance, when race selected human want minimum , maximum of age slider between 10-80, when faela chosen want between 10-70. possible, , if so, how?
if possible work without submitting race input before slider changes.
sure, try adding this:
$('#race').change(function () { if (this.value == "faela") { $('#slider').prop({ 'min': 10, 'max': 70 }); } if (this.value == "human") { $('#slider').prop({ 'min': 10, 'max': 80 }); } $('#slider').val(10); output.html('10'); }); (note in code slider started min/max of 14 , 60 changed 10 , 80.)
Comments
Post a Comment