DOM Interfaces
HTMLVideoElement
Represents video playback and extends HTMLMediaElement with video dimensions and video-specific features. The width property reflects display width markup, not intrinsic videoWidth. Intrinsic size is available after metadata loads. Example result: 320.
Formal Syntax & Structure
html syntaxhtml
const element = document.getElementById('demo'); // HTMLVideoElementReturn Value
HTMLVideoElement
An existing HTML DOM object associated with the video element in this example; this interface is a type, not a function return contract.
Working Example
Example Snippethtml
<video id="demo" width="320" controls></video><p> Result: <output id="result"></output></p><script> const e = document.getElementById('demo'); const result = value => { document.getElementById("result").textContent = String(value); }; result(e.width);</script>