Home Search Member List Faq Register Login  
JavaScript Tips
Toggle display

Thread Starter: Karamasoft   Started: 09-18-2007 12:39 PM   Replies: 0
 Karamasoft Support Forums » General Discussions » JavaScript Tips » Toggle display
 Printable Version    « Previous Thread   Next Thread »
  18 Sep 2007, 12:39 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Toggle display

You can toggle the display of an HTML element easily by toggling its style display value between 'none' and ''.


function ToggleDisplay(elemId) {

var elem = document.getElementById(elemId);

elem.style.display = (elem.style.display != 'none') ? 'none' : '';



<asp:LinkButton ID="lbToggleDisplay" runat="server"

OnClientClick="ToggleDisplay('pnlToggleDisplay'); return false;">Toggle


<asp:Panel ID="pnlToggleDisplay" runat="server">

Panel content here!


 Page 1 of 1 (1 items)
Karamasoft Support Forums » General Discussions » JavaScript Tips » Toggle display

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2019 Karamasoft LLC. All rights reserved.