JavaScript 中的 onmouseenter 事件是什麼?


滑鼠懸停在指標上時觸發 onmouseenter 事件。

示例

你可以嘗試執行以下程式碼來學習如何在 JavaScript 中使用onmouseenter事件 −

<html>
   <head>
      <script>
         <!--
            function sayHello() {
               alert("Mouse Hover")
            }
         //-->
      </script>
   </head>

   <body>
      <p onmouseenter = "sayHello()">This is demo text for mouseenter event.</p>
   </body>
</html>

更新於:2020 年 6 月 19 日

236 次瀏覽

啟動你的事業

透過完成課程獲得認證

開始使用
廣告
© . All rights reserved.