-1

I have a popup in my page.

I want to implement separate functionality for the close(X) button on this popup without affecting the other buttons in this popup.

I already tried the onunload() and onbeforeunload() events, but they are affecting the other buttons in the popup.

jwpfox
  • 5,124
  • 11
  • 45
  • 42

1 Answers1

1

Try this way, for more information check this answer

 $(window).unload(function() {
    //do something
}
Community
  • 1
  • 1
Damian Dominella
  • 610
  • 1
  • 7
  • 16