html to leave the page on a new page code example
Example: js when you leave
window.onbeforeunload = function(){
return 'Are you sure you want to leave?';
};
window.onbeforeunload = function(){
return 'Are you sure you want to leave?';
};