hx-confirm

hx-confirm 属性允许你在发出请求之前确认操作。当操作具有破坏性并且你想确保用户确实想要执行此操作时,此功能非常有用。

¥The hx-confirm attribute allows you to confirm an action before issuing a request. This can be useful in cases where the action is destructive and you want to ensure that the user really wants to do it.

这是一个例子:

¥Here is an example:

<button hx-delete="/account" hx-confirm="Are you sure you wish to delete your account?">
  Delete My Account
</button>

事件详细信息

¥Event details

hx-confirm 触发的事件在其 detail 中包含其他属性:

¥The event triggered by hx-confirm contains additional properties in its detail:

注释

¥Notes