Skip to content

Latest commit

 

History

History

hx-confirm

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Ask for confirmation using hx-confirm

This example shows how to use hx-confirm to ask for user confirmation before making a request (doc)

<ulhx-confirm="are you sure?"><lihx-get="/htmx">GET</li><lihx-post="/htmx">POST</li><lihx-put="/htmx">PUT</li><lihx-patch="/htmx">PATCH</li><lihx-delete="/htmx">DELETE</li></ul>

You can see here that hx-confirm, like many HTMX attributes, support inheritance. The HTML above has the same functional equivalent of the HTML below

<ul><lihx-get="/htmx" hx-confirm="are you sure?">GET</li><lihx-post="/htmx" hx-confirm="are you sure?">POST</li><lihx-put="/htmx" hx-confirm="are you sure?">PUT</li><lihx-patch="/htmx" hx-confirm="are you sure?">PATCH</li><lihx-delete="/htmx" hx-confirm="are you sure?">DELETE</li></ul>
close