Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I set visible back to true in jquery

Tags:

I am using the following code to hide a dropdown box:

  <asp:DropDownList ID="test1" runat="server" DataSourceID="dsTestType" CssClass="maptest1" visible="false"
    DataValueField="test_code" DataTextField="test_desc" AppendDataBoundItems="true" >
    <asp:ListItem></asp:ListItem>
  </asp:DropDownList>   

Somehow I try to show this dropdown by using the following code, but this is just not working for me. Anyone know why?

$("#test1").show();
like image 901
Jin Yong Avatar asked Mar 31 '11 06:03

Jin Yong


People also ask

How do I make label visible true in jQuery?

You can then use the jQuery hide() and show() functions. Show activity on this post. Set the CSS property visibility to visible . Show activity on this post.

How do I set visibility visible in jQuery?

visible = function() { return this. each(function() { $(this). css("visibility", "visible"); }); }; }(jQuery));

How can visible true and false in jQuery?

var _visible = ($('#elementID'). css('visibility') == 'hidden') ? '' : 'visibility:hidden'; $('#elementID'). attr('style',_visible);

How do I make something invisible in jQuery?

jQuery hide() Method The hide() method hides the selected elements. Tip: This is similar to the CSS property display:none. Note: Hidden elements will not be displayed at all (no longer affects the layout of the page).


1 Answers

Depends on how you hid it.

If you used the CSS visibility value then

$('#test1').css('visibility', 'visible');

If you used CSS `display'

$('#test1').css('display', 'block'); //or inline or any of the other combos

You might even have made it opacity = 0

$('#test1').css('opacity', '1');
like image 164
JohnP Avatar answered Sep 29 '22 22:09

JohnP