Copy / Paste this code between the <head> </ head> of your html page
function bye ()
alert ( "Thank you for visiting my site and see you soon!"), / / edit the text according to your wishes.
To use this feature, simply add the event in the tag onUnload <body>
NB: You must complete these steps on all pages.