Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 함께 해서 번역을 마치도록 도와 주세요!

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

Syntax

element.onmouseover = event handling code

Example

<!doctype html>  
<html>  
<head>  
<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';
    }


</script>  
<style type="text/css">  
    #foo {  
    border: solid blue 2px;  
    }  
</style>  
</head>  
<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>
</body>  
</html>  

Notes

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

Specifications

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

문서 태그 및 공헌자

 최종 변경: cvrebert,