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;
精彩评论