• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 579
  • Last Modified:

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?
0
prowebinteractive
Asked:
prowebinteractive
  • 4
  • 2
1 Solution
 
b0lsc0ttIT ManagerCommented:
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
0
 
b0lsc0ttIT ManagerCommented:
To see the tags that event supports look at http://www.w3schools.com/jsref/jsref_onmouseover.asp.

bol
0
 
prowebinteractiveAuthor Commented:
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
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
davbouchardCommented:
You can do it with stylesheet also. See example:

<html>
<head>

<style>
.Hand{
   cursor: pointer;
}
</style>

</head>

<body>
<table>
<tr>
<td class="Hand">Text here</td>
</tr>
</table>
</body>
</html>
0
 
davbouchardCommented:
I forgot to mention, hand is not a type of cursor, pointer is.

http://www.w3schools.com/css/pr_class_cursor.asp
0
 
b0lsc0ttIT ManagerCommented:
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
0
 
b0lsc0ttIT ManagerCommented:
You just answered my question. :D
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now