<p style='width: 100px'>текст</p> <script type='text/javascript'> document.onmouseout = function(e){ e=e||window.event; if (!(e.relatedTarget||e.toElement)) alert('ушли'); } </script>