画像の上にマウスポインタを移動しているときに JavaScript を実行します:
<img onmousemove="bigImg(this)" src="smiley.gif" alt="Smiley">
Try it Yourself ❯
onmousemove 属性は、ポインタを要素の上に移動しているときに発火します。
イベント属性 | |||||
---|---|---|---|---|---|
onmousemove | Yes | Yes | Yes | Yes | Yes |
なし。
<element onmousemove="script">
値 | 説明 |
---|---|
script | script は onmousemove で実行される |
サポートする HTML タグ: | 次の要素を除くすべての HTML 要素: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> |
---|
HTML DOM リファレンス:onmousemove イベント