How to change color of linkbutton in asp.net

{0 Comments}

In this article you will know how to change linkbutton color using JavaScript on clicking on them. For this I have created an asp linkbutton and then add this following JavaScript 

 Javascript |  copy code |? 
1
<script>
2
    function changeColor(e)
3
    {
4
       e.style.color = "red";
5
       return false;
6
    }
7
    </script>

After adding above JavaScript I finally add this property of change color function and finally the result is as below this code. 

 HTML |  copy code |? 
1
OnClientClick="return changeColor(this);"

Leave a Comment

Your email address will not be published.