Get started with htmx CDN

BSD 2-Clause licensed

HTMX is a progressive enhancement library that enables making asynchronous HTTP requests and updating parts of a webpage without a full page reload.

Tags:
  • AJAX
  • HTML

Stable version

Copied!

How to start using htmx CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with htmx CDN - cdnhub.io</title>
  <link rel="stylesheet" href="styles.css">
  <script src="https://cdn.cdnhub.io/htmx/1.9.11/htmx.min.js"></script>
</head>
<body>
  <button id="load-data-btn">Load Data</button>
  <div id="content"></div>

  <script>
    document.getElementById('load-data-btn').addEventListener('click', () => {
      htmx.get('/api/data').then((response) => {
        document.getElementById('content').innerHTML = response;
      });
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions