Monitor slider events with type="range" in real time

The onchange event will first come to mind, but the onchange event is only triggered when the mouse is released. If you want to monitor in real time, you need to use the oninput event, and IE10 does not support the oninput event. In order to be compatible, it is best to monitor the change of the range at the same time. and the input event:

<input type="range" oninput="getVal(this.value)" onchange="getVal(this.value)">

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326440495&siteId=291194637