Solved

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

Posted on 2006-11-09
7
564 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

830 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