Javadomain.in - Prompt before tab close Demo

If you close this tab, it will ask you with the prompt, "Do you really want to close ?".

This can be implemented in payment pages/registration pages etc.,
If user clicked the close tab by mistake also, he is having the second chance to continue his work

Tutorial