type="range"
<input> element as "slider".
input vs. change event
oninput is similar to the onchange event. The difference is that the oninput event occurs immediately after the value of an element has changed, while onchange occurs when the element loses focus, after the content has been changed.
簡單說,當我們拖曳滑桿的時候,隨時都會觸發 oninput 事件,但 onchange 事件是拖曳完放開滑鼠後才會觸發一次。
Last updated