You can't do this with jQuery, visible="false"
in asp.net means the control isn't rendered into the page. If you want the control to go to the client, you need to do style="display: none;"
so it's actually in the HTML, otherwise there's literally nothing for the client to show, since the element wasn't in the HTML your server sent.
If you remove the visible
attribute and add the style
attribute you can then use jQuery to show it, like this:
$("#elementID").show();
Old Answer (before patrick's catch)
To change visibility
, you need to use .css()
, like this:
$("#elem").css('visibility', 'visible');
Unless you need to have the element occupy page space though, use display: none;
instead of visibility: hidden;
in your CSS, then just do:
$("#elem").show();
The .show()
and .hide()
functions deal with display
instead of visibility
, like most of the jQuery functions :)