Event handler onmouseout
(Bubbles: Yes, Cancelable: Yes) terjadi ketika pointer mouse dipindahkan dari area dalam elemen menuju keluar area elemen. Event handler ini valid untuk hampir semua elemen.
Berikut contoh meregister event handler onmouseout
via 'inline model':
<A HREF="#" ONMOUSEOUT="alert('Halo saya event handler')">Visit to X.com</A>
Berikut contoh meregister event handler onmouseout
via 'traditional model':
<A HREF="#" ID="anchorID">Visit to X.com</A>
<SCRIPT TYPE="text/javascript">
function HandleEvent()
{
alert('Halo saya event handler!');
}
document.getElementById("anchorID").onmouseout=HandleEvent;
</SCRIPT>
Berikut contoh meregister event handler onmouseout
via DOM:
<A HREF="#" ID="anchorID">Visit to X.com</A>
<SCRIPT TYPE="text/javascript">
function HandleEvent()
{
alert("Halo saya event handler!");
}
var anchorElem=document.getElementById("anchorID");
anchorElem.addEventListener("mouseout", HandleEvent, false);
</SCRIPT>