The code below is not working for me in Chrome or FireFox.

<body onUnload="alert('Dont Leave');">
What I expected the code to do is, create an alert box when I leave the page. onMouseOver and onClick are working fine for me and do create alerts.

Is there an error in the code?