We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0da0383 commit f4cc838Copy full SHA for f4cc838
1 file changed
www/content/examples/confirm.md
@@ -37,9 +37,9 @@ which is then picked up by `hx-trigger`.
37
<script>
38
document.addEventListener("htmx:confirm", function(e) {
39
// The event is triggered on every trigger for a request, so we need to check if the element
40
- // that triggered the request has a hx-confirm attribute, if not we can return early and let
41
- // the default behavior happen
42
- if (!e.detail.elt.hasAttribute('hx-confirm')) return
+ // that triggered the request has a confirm question set via the hx-confirm attribute,
+ // if not we can return early and let the default behavior happen
+ if (!e.detail.question) return
43
44
// This will prevent the request from being issued to later manually issue it
45
e.preventDefault()
0 commit comments