TAG
JavaScript
Result
Run
License
<video id="player" controls> <source src="/assist/resources/media/video/movie.mp4" type="video/mp4" /> </video> <p> <input id="height" type="range" min="200" max="400" step="1" value="200" /> <span>200</span> </p>
window.addEventListener("DOMContentLoaded", function() { const $elPlayer = document.getElementById("player"); const $elHeight = document.getElementById("height"); $elHeight.addEventListener("input", e => { let height = e.currentTarget.value; $elPlayer.height = height; e.currentTarget.nextElementSibling.textContent = height; }); $elHeight.dispatchEvent(new Event("input")); });
Console
expand_less
License
License
by DevDic
Close