Back to Practical Aspnetcore

Using hx-on to handle events

projects/htmx/hx-on/README.md

latest548 B
Original Source

Using hx-on to handle events

This example shows how to use hx-on to handle HTML Events using inline JavaScript code (doc)

html
    <ul>
        <li hx-on:click="alert('click');">hx-on:click</li>
        <li hx-on:mouseover="alert('hover');">hx-on:mouseover</li>
        <li hx-on:dblclick="alert('double click');">hx-on:dblclick</li>
    </ul>

hx-on handles HTML Events and HTMX Events.