We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


Nasi wolontariusze nie przetłumaczyli jeszcze tego artykułu na język Polski. Dołącz do nas i pomóż go przetłumaczyć!
Można także przeczytać artykuł w języku: English (US).

The onmouseover property returns the onMouseOver event handler code on the current element.


element.onmouseover = event handling code


<!doctype html>  
<title>onmouseover/onmouseout event example</title>  
<script type="text/javascript">  
    function initElement()  
        var p = document.getElementById("foo");  

        p.onmouseover = showMouseOver;
        p.onmouseout = showMouseOut;

    function showMouseOver()  
        var notice = document.getElementById("notice");
        notice.innerHTML = 'mouse over detected';
    function showMouseOut()
        var notice = document.getElementById("notice");
        notice.innerHTML = 'mouse out detected';

<style type="text/css">  
    #foo {  
    border: solid blue 2px;  
<body onload="initElement();">  
    <span id="foo">My Event Element</span>
    <p>move your mouse over and out the above element.</p>  
    <div id="notice"></div>


The mouseover event is raised when the user moves the mouse over a particular element.


Specification Status Comment
HTML Living Standard
The definition of 'onmouseover' in that specification.
Living Standard  

Browser Compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) (Yes) ? ? ? ?
Feature Android Android Webview Edge Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? (Yes) (Yes) ? ? ? ? ? (Yes)

Autorzy i etykiety dokumentu

 Ostatnia aktualizacja: erikadoyle,