开发者

how to make event in js

chaychu = document.getElementById('chaychu');
chaychu.onMouseOver ="chaychu.stop";

How to make this code works- what is wrong开发者_C百科 with it?


You need to wrap it in function body:

chaychu = document.getElementById('chaychu');
chaychu.onmouseover = function(){
    // your code here....
};

If there is a function already there, you should do this instead:

chaychu = document.getElementById('chaychu');
chaychu.onmouseover = functionName;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜