htmx 4.0 is under construction — migration guide

load

Fired immediately after initialization

The load trigger event fires immediately after element initialization, mimicking the standard DOM load event.

When It Fires

Right after htmx:after:init, providing a familiar event name for developers.

Event Detail

Empty - no additional context provided.

Example

document.addEventListener('load', (evt) => { if (evt.target.hasAttribute('hx-get')) { console.log('htmx element loaded:', evt.target); } });

This provides compatibility with standard DOM patterns.