Reputation: 165
How to dynamically set the max, min and step value dynamically for HTML5 range control?
<input id="slider" type ="range" min="0" max="300" step="20" value="100" />
I have used the following try but no luck for me
$('#slider').attr('min', 10);
$('#slider').attr('max', 100);
Upvotes: 1
Views: 3950
Reputation: 165
I have found the answer by changing the code on server side by using the constant value for Min,Max and step.
Answer Found:
var div = document.createElement('div');
div.innerHTML = 'input id="slider" alt="Slider" title="Slider" type ="range" min="'+Constant+'" max="'+Constant+'" step="'+Constant+'" value="'+Constant+'" />';
document.getElementById('div').appendChild(div);
Thanks
Upvotes: 0