htmx banner

  </> htmx
high power tools for html

<button hx-post="/clicked" hx-target="#result">Click Me!</button>
 

[ docs ] [ reference ] [ examples ] [ github ] [ book ] [ download ]

Search the htmx docs & site via AltaVista:  
 

:: Quick Links ::
---

> Documentation

> Attribute Reference

> Live Examples

> GitHub Source

> Hypermedia Book

---

:: Download ::

<script src=
 "htmx.min.js">
</script>


Current release:
v1.x stable
~14kb gzipped!!


---

:: Stats ::

Visitors since 1998:
counter

Zero dependencies.
Zero frameworks.
Zero excuses.


computer
Welcome to htmx!!
---

htmx gives you access to AJAX, CSS transitions, WebSockets and Server-Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypertext.

<!-- AJAX request via HTML attribute! -->
<div hx-get="/news"
      hx-trigger="load"
      hx-swap="innerHTML">
  Loading latest news...
</div>

htmx is the successor to Intercooler.js and completes HTML as a true hypertext system for the Information Superhighway. It removes the artificial constraints that browsers have placed on HTTP requests and lets your HTML do what it was ALWAYS meant to do!!

---

Why htmx?

▶ No Frameworks!!
Forget downloading 40 megabytes of JavaScript just to make a button work. htmx is 14kb and has ZERO dependencies.
▶ 67% Less Code!!
Real-world applications show htmx requires up to 67% fewer lines of code compared to heavyweight JavaScript approaches.
▶ Pure HTML!!
Add hx-get, hx-post, hx-trigger attributes directly to your tags. No separate .js files needed!!
▶ WebSockets Too!!
Real-time web applications using WebSocket connections and Server-Sent Events — all controlled from HTML attributes alone.

---

Key Attributes — The Power of htmx

Attribute What it does
hx-get Issues an HTTP GET to the given URL
hx-post Issues an HTTP POST to the given URL
hx-trigger Specifies what event triggers the request
hx-target Specifies which element to update
hx-swap Controls how the response is swapped in
hx-ws Connects to a WebSocket server
hx-boost Converts all links to AJAX requests


Sorry if this page loads slowly -- lots of code examples!! :-)
:: What's New!! ::
---

* NEW! v1.x released!

* WebSocket support now built-in!!

* CSS transitions work automatically with hx-swap

* Server-Sent Events (SSE) support added

* Hypermedia Systems book now available at hypermedia.systems!!

---

:: Philosophy ::

"HTML is a complete hypertext system. It should not be limited to only anchor tags and forms making HTTP requests."

htmx extends HTML so that any element can issue HTTP requests, any event can trigger them, and any part of the page can be updated. This is how the web was ALWAYS meant to work!!

---

:: Requirements ::

* Any modern web browser

* A web server (Apache, IIS, etc.)

* One <script> tag in your HTML

* That's it. Seriously. No build tools!! No npm!! No node_modules!!

---

:: Rings ::

HTML Writers Guild
HTML Writers Guild
Prev | Next

SiliconValley Webring
webring
Prev | Next

Get Started RIGHT NOW!!

Just add this one line to your HTML and you have the full power of htmx on your web site:

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

Or download the file and host it yourself. Only 14kb gzipped!! Works with Netscape Navigator 4.0, Internet Explorer 4.0, and beyond.

Read the full docs at htmx.org/docs/  |  See live examples at htmx.org/examples/

Netscape Now Internet Explorer Valid HTML JavaScript Free Speech

---

Documentation | Reference | Examples | GitHub | Hypermedia Book

email  webmaster@htmx.org