Get started with htmx 4 — dynamic web pages without JavaScript

However, you can modify triggers on a control by adding an hx-trigger attribute:


Here, the button will fire on a click, but only if the Shift key is held down at the same time. This might be a good way to prevent a destructive action from accidentally taking place, like a delete.

Other htmx trigger modifications include delaying or throttling the triggered event, firing an event only once, firing an event on a regular interval, firing an event when it scrolls into view, or combinations of the above. For instance, using load delay:1s causes the event to fire one second after loading.

Source link

spot_img
spot_img

Leave a reply

Please enter your comment!
Please enter your name here