How to stop video in JavaScript

DOM
By Jad Joubran · 
Last updated Feb 26, 2024
<video id="video">
  <source src="movie.mp4" type="video/mp4" />
</video>
const video = document.querySelector("#video");

// Stop = pause + reset the playhead
video.pause();
video.currentTime = 0;