JavaScript - ..Need to make the visible button through jquery.

Asked By shah zeb on 27-Dec-11 05:35 AM

I have button in my Asp.Net page, who's display property i have set to false.
I need to make it visible in. how to do that i have tried the below methods but no gains.

// $('#btnDetail').show();

// $('#btnDetail').attr("Visible", true);

How can i acheive this?
Web Star replied to shah zeb on 27-Dec-11 05:38 AM
Try this way to hide/show of button based on text input

$("textarea").keyup(function() {
if ($(this).val().replace(/ /g, '') == '')
shah zeb replied to Web Star on 27-Dec-11 05:49 AM
Not working...
smr replied to shah zeb on 27-Dec-11 05:52 AM

To change visibility, you need to use, 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:


The and functions deal with display instead of visibility, like most of the jQuery functions :)

dipa ahuja replied to shah zeb on 27-Dec-11 05:58 AM
<div class="detailDiv">
This is example of Hide show div element using jquery 

<button class="button">Show or Hide div </button>

 <script type="text/javascript">
   $(document).ready(function () {
     $('.button').click(function () {