PROBLEM IN ASSIGN CSS ON BUTTON CONTROL BY JAVASCRIPT

Vikas Giri

Total Post:13

Points:91
Posted by  Vikas Giri
 1775  View(s)
Ratings:
Rate this:
we use one asp button control and apply css class for background color and forecolor on click event
problem in syntax how use it
please give the solution  
thanx in advance
  1. Amit Singh

    Post:103

    Points:721
    Re: Problem in assign css on button control by javascript

    Check this code

    <asp:button ID="Button1" runat="server" text="Button"  />
           <script type="text/javascript">        
                   document.getElementById("Button1").style.backgroundColor = "red";
                   document.getElementById("Button1").style.color = "Green";        
            </script>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!