I have a simple project but i'm newbie in javascript, what I need is to force mouse to click on popup window [Leave Page] how to do that?
You can't not do that. Only user can do this, this is disabled due to security reasones. Why would you like to do that?
It is impossible. If you do not want the user to have any other option than Leave Page, remove the confirmation dialog.