<div id="browser-support-alert" class="alert h4">
  Your browser support: <strong id="browser-support"></strong>
</div>
<div class="alert alert-warning">
  Native lazy-loading is supported by Chromium-based browsers from version 75. Please note: Even if the native lazy-loading feature flags are enabled and lazy-loading is effectively happening, feature detection still fails up to Chrome 75.0.3759.4 (canary preview version). Your user agent: <span id="user-agent"></span>.
</div>
const isSupported = "loading" in HTMLImageElement.prototype

const $browserSupportAlert = document.getElementById("browser-support-alert")
const $browserSupport = document.getElementById("browser-support")
if (isSupported) {
  $browserSupportAlert.classList.add("alert-success")
  $browserSupport.innerHTML = "supported"    
} else {
  $browserSupportAlert.classList.add("alert-danger")
  $browserSupport.innerHTML = "not supported"    
}

document.getElementById("user-agent").innerHTML = navigator.userAgent

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css

External JavaScript

This Pen doesn't use any external JavaScript resources.