Click to See Complete Forum and Search --> : [RESOLVED] Style attribute hover


BlasterV
04-17-2008, 10:01 AM
I am aware the best way to do this is through CSS, but I need to add this style attribute during a C# event for specific elements, so what I want to do is:

<input type="label" style=":hover { text-decoration:underline; }"></input>

So basically I want to add in the style attribute of an html element an underline when the user hovers his mouse over the label's text. Obviously, what I put in the style attribute here does not work.

I've tried such variations such as a:hover a:link:hover a.hover, etc.

Through CSS a:hover works, but I can't use CSS.

Any help would be appreiciated!

Fang
04-17-2008, 10:19 AM
Won't work; you'll have to use JavaScript

BlasterV
04-17-2008, 10:31 AM
This is fine I can use javascript, how would I go about doing it through javascript?

Fang
04-17-2008, 10:47 AM
<input type="label" onmouseover="this.style.textDecoration='underline';" onmouseout="this.style.textDecoration='none';">

BlasterV
04-17-2008, 10:54 AM
Awesome. Thanks.