Onmouseover

  • Thread starter Thread starter Leon
  • Start date Start date
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.
 
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'"
 
Back
Top