htmx/www/content/attributes/hx-prompt.md
William Jackson 46badfe0b1
Add descriptions for attribute pages (#3158)
Descriptions for attribute pages
2025-02-07 17:07:13 -07:00

616 B

+++ title = "hx-prompt" description = """
The hx-prompt attribute in htmx allows you to show a prompt before issuing a request. The value of the prompt will
be included in the request in the HX-Prompt header.""" +++

The hx-prompt attribute allows you to show a prompt before issuing a request. The value of the prompt will be included in the request in the HX-Prompt header.

Here is an example:

<button hx-delete="/account" hx-prompt="Enter your account name to confirm deletion">
  Delete My Account
</button>

Notes

  • hx-prompt is inherited and can be placed on a parent element