Onmouseover

L

Leon

Hi evrybody.

I have a hyperlink that I add to my webpage dynamically (in my code). I need
it to be underlined only when user hovers over it.
I put in my code:
MyHyperLink.Font.Underline = False

and thought something like:
MyHyperLink.Attributes.Add("onmouseover", "this.Font.Underline=True")
would work for me.
But it does not work for me.
What would be the correct syntax?

Thank you.
 
A

Andrew Morton

Leon said:
I have a hyperlink that I add to my webpage dynamically (in my code).
I need it to be underlined only when user hovers over it.
I put in my code:
MyHyperLink.Font.Underline = False

and thought something like:
MyHyperLink.Attributes.Add("onmouseover", "this.Font.Underline=True")
would work for me.
But it does not work for me.
What would be the correct syntax?

In onmouseover, you're working client-side in Javascript, so

onmouseover="this.style.textDecoration='underline'"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top