loop
loop attribute
The loop
attribute in HTML is a boolean used with <video>
and <audio>
elements. When added, it makes the media automatically replay from the beginning after finishing, ensuring seamless, continuous playback.
Syntax
<tagname loop>
Example
<video controls loop>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
Values
The loop
attribute is a boolean, meaning it doesn't require any associated values.
loop
attribute functions as soon as it is included, without needing a value to be specified.Applies To
The loop
attribute can be applied to the following HTML elements:
Conclusion
The loop
attribute in HTML enables media elements such as <video>
and <audio>
to automatically replay once they’ve finished, providing uninterrupted playback. As a boolean attribute, it does not require a value. This functionality improves the overall user experience for both video and audio content.
loading
The HTML loading attribute controls the timing of image or iframe loading, improving performance by deferring content that’s off-screen or loading it immediately when needed.
muted
The muted attribute in HTML is a Boolean attribute used with media elements such as <video> or <audio>. When applied, it ensures that the audio is turned off by default.