onMouseOver and the cursor

In my <TH> tag I want to do:

<TH id="th1" onMouseOver="this.style='cursor:hand';" >Company</TH>

and then have the cursor return to the default on onMouseOut. But I have been trying a number of variations on the setting for onMouseOver and so far none of them owrk, plenty of syntax errors though.
RichardFoxAsked:
Who is Participating?
 
GrandSchtroumpfConnect With a Mentor Commented:
BTW, "hand" is not in the standards, so you should use "pointer" instead:

onMouseOver="this.style.cursor='pointer';"
0
 
GrandSchtroumpfCommented:
<TH id="th1" onMouseOver="this.style.cursor='hand';" >
0
 
PreeceCommented:
Nice!  I'll use that in the future!
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
GwynforWebCommented:

<TH id="th1" style='cursor:pointer' >Company</TH>

no need for the mouseover
0
 
PreeceCommented:
even better yet!
0
 
COBOLdinosaurCommented:
Not for points just for best practices... do it in the stylesheet and you can support the olde IE browers as well:
<style type="text/CSS">
#th1 {cursor:hand;cursor:pointer;}
</style>

Cd&

0
 
DaydreamsCommented:
To support older browsers, the order is imortant:

th1 {cursor:pointer;cursor:hand;}    <<--pointer is first

http://www.quirksmode.org/css/cursor.html


Modern browsers will ignore the incorrect hand declaration, while versions of IE which don't know the proper use of pointer will use the hand declaration. Using "hand" will not validate though.
0
 
DaydreamsCommented:
One more reference:

http://www.echoecho.com/csscursors.htm

See the table on cursor prprties and scroll down to the values "hand", "pointer" and then "cross-browser" and mouseover "test" in your chosen browser.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.