开发者

how to make event in js

开发者 https://www.devze.com 2023-01-23 10:34 出处:网络
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 ="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

精彩评论

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