Problem in assign css on button control by javascript

Total Post:13

Points:91
 2079  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. 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>

      Modified On Mar-29-2018 03:45:16 AM

Answer