| 1 | --- |
| 2 | title: "load" |
| 3 | description: "Fired immediately after initialization" |
| 4 | --- |
| 5 | |
| 6 | The `load` trigger event fires immediately after element initialization, mimicking the standard DOM `load` event. |
| 7 | |
| 8 | ## When It Fires |
| 9 | |
| 10 | Right after [`htmx:after:init`](/reference/events/htmx-after-init), providing a familiar event name for developers. |
| 11 | |
| 12 | ## Event Detail |
| 13 | |
| 14 | Empty - no additional context provided. |
| 15 | |
| 16 | ## Example |
| 17 | |
| 18 | ```javascript |
| 19 | document.addEventListener('load', (evt) => { |
| 20 | if (evt.target.hasAttribute('hx-get')) { |
| 21 | console.log('htmx element loaded:', evt.target); |
| 22 | } |
| 23 | }); |
| 24 | ``` |
| 25 | |
| 26 | This provides compatibility with standard DOM patterns. |