Solved

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

Posted on 2006-11-09
7
567 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

623 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