Exécuter
❯
Exécuter le code
Ctrl+Alt+R
Enregistrer le code
Ctrl+Alt+A
Changer d'orientation
Ctrl+Alt+O
Changer de thème
Ctrl+Alt+D
<!DOCTYPE html> <html> <body> <button onclick="getCurTime()" type="button">Obtenir la position actuelle du temps</button> <button onclick="setCurTime()" type="button">Set time position to 5 secondes</button><br> <video id="myVideo" width="320" height="176" controls> <source src="mov_bbb.mp4" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> Votre navigateur ne prend pas en charge la vidéo HTML5. </video> <script> let vid = document.getElementById("myVideo"); function getCurTime() { alert(vid.currentTime); } function setCurTime() { vid.currentTime=5; } </script> <p>Vidéo fournie par<a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p> </body> </html>