JSFiddle - React, Tailwind, and code Playground
by mpsingh2003
HTML
<pre>
<code>'loading' in HTMLImageElement.prototype === <span>false</span>
</code>
</pre>
<div class="img-conatiner">
<img loading="lazy" src="https://placekitten.com/400/400" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/401/401" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/402/402" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/403/403" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/404/404" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/405/405" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/406/406" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/407/407" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/408/408" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/409/409" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/410/410" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/411/411" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/412/412" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/413/413" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/414/414" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/415/415" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/416/416" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/417/417" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/418/418" alt="" width="450" height="450">
<img loading="lazy" src="https://placekitten.com/419/419" alt="" width="450" height="450">
<img...
CSS
img {
display:block;
}
JavaScript
const hasSupport = 'loading' in HTMLImageElement.prototype;
document.documentElement.className = hasSupport ? 'pass' : 'fail';
document.querySelector('span').textContent = hasSupport;