انتقل إلى محتوى الدرس
فقرة فرعية #6 من درس: JS Events

onmouseover Event

ستتعلم في هذا الدرس ال JavaScript Events وكيفة كتابتها واين تكتب ولماذا تستخدم مع لغة ال JavaScript

1 صفوف تعليمية
جافا سكريبت
5,402 مشاهدة

شرح صفوف ومحتوى الفقرة

الصف 1 شرح توضيحي

يقع الحدث onmouseover عندما يتحرك مؤشر الماوس على عنصر أو على أحد العناصر الفرعية له.



Syntax

HTML
object.onmouseover = function(){myScript};

Example

HTML
document.getElementById("demo").onmouseover = function() {mouseOver()};
document.getElementById("demo").onmouseout = function() {mouseOut()};

function mouseOver() {
  document.getElementById("demo").style.color = "red";
}

function mouseOut() {
  document.getElementById("demo").style.color = "black";