마우스오버 요소 위에 마우스를 가져가면 이벤트가 트리거됩니다.
예시
다음 예제를 실행하여 onmouseover 이벤트에서 JavaScript 함수를 호출하는 방법을 배울 수 있습니다.
라이브 데모
<html>
<head>
<script>
<!--
function over() {
document.write ("Mouse Over");
}
function out() {
document.write ("Mouse Out");
}
//-->
</script>
</head>
<body>
<p>Bring your mouse inside the division to see the result:</p>
<div onmouseover="over()" onmouseout="out()">
<h2> This is inside the division </h2>
</div>
</body>
</html>