var vid = document.getElementById("myVideo"); function enableAutoplay() { vid.autoplay = true; vid.load(); }