Computer >> Máy Tính >  >> Lập trình >> Javascript

Sự kiện onmouseover trong JavaScript là gì?


onmouseover sự kiện kích hoạt khi con trỏ chuột di chuyển qua một phần tử.

Ví dụ

Bạn có thể thử chạy mã sau để tìm hiểu cách làm việc với onmouseover sự kiện trong JavaScript -

<html>
   <head>
      <script>
         <!--
            function sayHello() {
               alert("Mouse Over")
            }
         //-->
      </script>
   </head>
   <body>
      <p onmouseover = "sayHello()">This is demo text for mouseover event.</p>
   </body>
</html>