hx-delete

hx-delete 属性将导致元素向指定的 URL 发送 DELETE 请求,并使用交换策略将 HTML 交换到 DOM 中:

<button hx-delete="/account" hx-target="body">
  Delete Your Account
</button>

此示例将导致 button/account 发送 DELETE 请求,并将返回的 HTML 交换到 bodyinnerHTML 中。

Notes