How can I change the color of a dynamically generated linkbutton on mouse cursor focus with JavaScript?
Question
Code:
LinkButton linkButton = new LinkButton();
linkButton.OnClientClick="changecolor";--i need to change this to on mouse focus event
There is no property for link button like we have for onClientClick
.
Solution
linkButton.Attributes.Add("onmouseover", "yourChangeColorFunction();");
OTHER TIPS
You can define the CSS class for tha link button that will have different color when you hover.
a
{
color:black;
}
a.hover
{
color:blue;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow