HTMX Documentation

Add HTMX to your project in seconds and build modern, dynamic web apps with simple HTML.

1. Include HTMX in Your Project

Add the following script tag to your HTML, just before the closing </body> tag:

<script src="https://unpkg.com/htmx.org@2.0.4"></script>

2. Make Your First AJAX Request

With HTMX, you can make AJAX requests using simple HTML attributes. For example:

<button hx-get="/hello" hx-target="#result">Say Hello</button>
<div id="result"></div>

When the button is clicked, HTMX will send a GET request to /hello and replace the contents of #result with the response.

3. How It Works

4. Next Steps