Khi con trỏ chuột di chuyển qua một phần tử, onmousemove trình kích hoạt thuộc tính. Bạn có thể thử mã sau để triển khai onmousemove thuộc tính -
Ví dụ
<!DOCTYPE html>
<html>
<body>
<h3 id = "myid" onmousemove = "mouseMove()">
This is demo heading.
</h3>
<p>Click above and then release.</p>
<script>
function mouseMove() {
document.getElementById("myid").style.color = "red";
}
</script>
</body>
</html>