hiiragi's ブログ

主にコンピュータ関係の備忘録を書いてます

mouseover, mouseoutのevent.target等について

target, currentTarget, relatedTarget, srcElement, fromElement, toElementが紛らわしいので調べた。

W3C DOM

target イベントが発生した要素
currentTarget イベントリスナを登録した要素
relatedTarget mouseover: 移動元の要素, mouseout: 移動先の要素

Microsoft DHTML

srcElement イベントが発生した要素
fromElement mouseover, mouseoutで移動元の要素
toElement mouseover, mouseoutで移動先の要素


参考にしたリンク, 動作確認サンプルはこちらで
http://jsdo.it/s_hiiragi/xYCP/fullscreen