3

Using javascript, when the tab is closed the alert is shown to user to confirm leaving the page , but the problem is i want to detect which button "Leave this page" or "stay on this page" is clicked as i have to perform some function based on this.

<script>
 window.onbeforeunload = function() {
        return 'are you sure';
    }
</script>
Atul Prajapati
  • 177
  • 1
  • 11

0 Answers0