Forum

js, jquery - confir...
 
Notifications
Clear all

js, jquery - confirm() popup with decision

1 Posty
1 Users
0 Reactions
581 Widok
0
Topic starter

example code

1 Answer
0
Topic starter
        $(function () {
            $(".confirm,.confirmation").click(function (e) {
                if (!confirm()) {
                    e.preventDefault();
                    return;
                }
            });
        })

 

how to use:

  1. add class="confirm" to any clickable element
  2. NO response - any redirect or code will be prevent from execution
  3. YES response - proceed with any default reaction/code

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: