运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body> <h1>HTML DOM Events</h1> <h2>The onseeked and onseeking Events</h2> <p>The difference between onseeking and onseeked.</p> <p>onseeking occurs everytime the user STARTS seeking a new position in the video.</p> <p>onseeked occurs when the user is FINISHED seeking a new position in the video.</p> <video controls onseeking="myFunction()" onseeked="mySecondFunction()"> <source src="mov_bbb.mp4" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video> <p>Move to a new position in the video.</p> <p>Seeking occured: <span id="demo"></span> times.</p> <p>Seeked occured: <span id="demo2"></span> times.</p> <script> let x = 0; function myFunction() { document.getElementById("demo").innerHTML = x += 1; } let y = 0; function mySecondFunction() { document.getElementById("demo2").innerHTML = y += 1; } </script> </body> </html>