diff options
Diffstat (limited to 'www/content/examples/confirm.md')
-rw-r--r-- | www/content/examples/confirm.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/www/content/examples/confirm.md b/www/content/examples/confirm.md index 42f70031..5b3a272a 100644 --- a/www/content/examples/confirm.md +++ b/www/content/examples/confirm.md @@ -37,9 +37,9 @@ which is then picked up by `hx-trigger`. <script> document.addEventListener("htmx:confirm", function(e) { // The event is triggered on every trigger for a request, so we need to check if the element - // that triggered the request has a hx-confirm attribute, if not we can return early and let - // the default behavior happen - 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 // This will prevent the request from being issued to later manually issue it e.preventDefault() |