I am a beginner and have been attempting to solve this problem for several hours. On my website, there are numerous YouTube embeds hidden behind a <details> tag. When the summary is clicked, it expands and displays all of the embeds. The issue is that the page loads all of the embeds, even though they are hidden by default, and this causes a long load time. I have attempted to fix this by adding "loading:'lazy'" at the end of the iframe, but it has
online2yu omeglz not had any effect. Any assistance would be greatly appreciated.
Here is an example of what I have tried:
<iframe max-width="315" height="300" src="link" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen loading="lazy"></iframe>