Question:
HTML for onmouseover?
2007-08-22 11:59:47 UTC
Hi people,

How do I use the onmouseover function to do these two things at a time - change image on the same spot and show the style cursor hand? I know how to do only one of them but when I try to add the second function, it didn't work. Hope there is an expert out there who can help. Thanks a lot!
Four answers:
2007-08-22 13:29:21 UTC
onmouseover="function1(); function2();" (without the space between function1 and function2 . Yahoo! truncates the code.)



Alternatively, you could call function2() from within function1().



The semi-colon between the two functions is very important; it lets the script know that it has to process a new line of code.
J P
2007-08-22 20:03:05 UTC
To use multiple javascript commands in an onmouseover tag you just need to seperate them with a semi-colon ; like this:







However, to simply make the "hand" show up when you are over the element just add style="cursor: pointer;" to your element. There is really no reason to have this in the onmouseover event.
Big D
2007-08-22 19:07:41 UTC


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...