user968441
user968441

Reputation: 1471

How to set div's property by jquery?

I want some hide/show functionality with my div tag. I am using below code to do that but its not working.

.aspx

    <div id="divCust" runat="server" clientidmode="Static" visible="false">
         abc Test
        </div>

<asp:Button ID="Button1" OnClientClick="return editDetail();" runat="server"
                Text="Add"/>

.js file

function editDetail() {
    $('#divCust').css("display", "block");
}

What i missing in this code??Is it ok or what?? If any one have any idea about this than please help me in this.

Upvotes: 0

Views: 296

Answers (1)

F.P
F.P

Reputation: 17831

visible != display

Write style="display: none;" in your div instead of visible = "false" and your code should work.

Upvotes: 2

Related Questions