I am trying to change the background of a div after clicking a button. this are the codes. Div I want to change color:
<div id="example1" runat="server">
</div>
and CSS for it:
#example1 {
position: absolute;
z-index: 5;
top:0;
background-color: orange;
width: 310px;
height: 34px;
color: white;
border-radius: 4px;
}
I want to change it to this:
#example2 {
position: absolute;
z-index: 5;
top:0;
background-color: red;
width: 380px;
height: 38px;
color: white;
border-radius: 4px;
}
I tried to write some code at Page.aspx.cs
example1.CssClass = "example2";
but looks like CssClass is not a function of the div. how can I add it? or whats a way to do it on C#?