Solved

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

Posted on 2006-11-09
7
559 Views
Last Modified: 2008-03-17
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
Comment
Question by:prowebinteractive
  • 4
  • 2
7 Comments
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17909802
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
 
LVL 54

Expert Comment

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

bol
0
 

Author Comment

by:prowebinteractive
ID: 17909823
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 6

Accepted Solution

by:
davbouchard earned 500 total points
ID: 17910048
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
 
LVL 6

Expert Comment

by:davbouchard
ID: 17910058
I forgot to mention, hand is not a type of cursor, pointer is.

http://www.w3schools.com/css/pr_class_cursor.asp
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17910073
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
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 17910081
You just answered my question. :D
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now