Get started with alt CDN

MIT licensed

Alt JS: lightweight, flexible UI builder with virtual DOM, declarative API.

Tags:
  • alt
  • es6
  • flow
  • flux
  • react
  • unidirectional

Stable version

Copied!

How to start using alt CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with alt CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/alt/0.18.6/alt.min.js"></script>
</head>
<body>
  <img src="image.jpg" alt="A beautiful sunset" loading="lazy" id="image">
  <button onclick="handleImageLoad()">Check Image Load</button>
  <script>
    function handleImageLoad() {
      const image = document.getElementById('image');
      alt(image).onload(function() {
        console.log('Image loaded with alt text:', this.alt);
      });
    }
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!

All versions