Link to home
Start Free TrialLog in
Avatar of prowebinteractive
prowebinteractive

asked on

Text with onmouseover="this.style.cursor='hand'" onmouseout="this.style.cursor='default'"

I have some text on a form that when the mouse is over I want to change the cursor style to hand

I know I can do it with a tag by doing the following:
<img src="image.gif" onmouseover="this.style.cursor='hand'" onmouseout="this.style.cursor='default'">

but how do I do it with simple text?
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

prowebinteractive,

Assign the onmouseover and onmouseout events to the element that holds the text (i.e. p, div, etc).  It will work the same as img.

Let me know if you have any questions or need more information.

b0lsc0tt
To see the tags that event supports look at http://www.w3schools.com/jsref/jsref_onmouseover.asp.

bol
Avatar of prowebinteractive
prowebinteractive

ASKER

cannot do that since it is in a <td> and it is just plain text in between drop down lists

I put the text in the following tag
<a href="#">Text</a>

It worked
ASKER CERTIFIED SOLUTION
Avatar of davbouchard
davbouchard

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I forgot to mention, hand is not a type of cursor, pointer is.

http://www.w3schools.com/css/pr_class_cursor.asp
The td or a tag can also have onmouseout or onmouseover.  From your last comment it seems like the problem is solved.  Is that correct?  If not then let us know if we can help.

bol
You just answered my question. :D