Why doesn't this text run?

A textbook gives an example. This can refer to the caller in the called function.
the following this is div

<script>
stat = function(){
    var taoId = document.getElementById("div2");
    taoId.onmouseover = function{
        this.align = "right";
    }
    taoId.onmouseout = function{
        this.align = "left";
    }
}
window.onload = stat;
</script>
<div id = "div2"></div>

Why doesn"t this example work? No text escape effect?

Apr.11,2021

. Because your function
function () {} is missing parentheses


What does the align in

this.align stand for
?

clipboard.png


1. There is a problem function () {} written in the method definition-- missing parentheses
2. Generally, we don't do this directly. We usually change the style by removing or and adding class

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea85e7-47c87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea85e7-47c87.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?