我使用这些最小值和最大值创建了一个范围输入元素:
<input type='range' min='0' max='9999999' id='mySlider'>
然后尝试将其值更改为无效:
// This does not work as intended, at least in Chrome.
// It wrongly moves the slider to the beginning.
slider.value = 5000000;
然后将滑块移到最右侧,可以正常工作:
slider.value = 9999999;
为什么第一段用于移动范围输入的代码不起作用? JsFiddle Demo