Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions www/content/examples/confirm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down