mouseover ( onmouseover )イベント
mouseover ( onmouseover )イベントは、このイベントが設定されたHTMLエレメント上にマウスポインターが入ったら発生するイベントです。
document.getElementById('example').addEventListener("mouseover", (event)=>{ console.log( 'event type : ' + event.type ); });
詳しくは Example を参照してください
mouseoverイベントはmouseoutイベントの対です。
mouseoverイベントに似たmousemove、mouseenterイベントがあります。 mouseoverイベントはバブルし、マウスポインターがエレメント上に入ったときだけイベントが発生します。
ページ内 Index
構文(Syntax)
in HTML
<tagelement onmouseover="oneFunction()">
in JavaScript
object.onmouseover = function(){ }; object.addEventListener("mouseover", script_);
備考(Remarks)
Bubbles | Yes |
Cancelable | Yes |
Interface | MouseEvent |
Supported HTML Elements | ALL HTML elements |
Example
mouseoverイベントに似たイベント、mousemoveイベント、mouseenterイベントの違いもテストできます。