Toggle Display (On / Off)

Ranjeet_8
Posted by Ranjeet_8 under JavaScript category on | Points: 40 | Views : 1549
JavaScript

<script language="javascript" type="text/javascript">
function TDisplay(elementID) {
var CurrentElement = document.getElementById(elementID);
CurrentElement.style.display = (CurrentElement.style.display != 'none') ? 'none' : '';
return false;
}
</script>

.ASPX Page

<asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="return TDisplay('panel1');">
Toggle Display(On / Off)</asp:LinkButton>
<asp:Panel ID="panel1" runat="server">
Panel content here!
</asp:Panel>

Comments or Responses

Login to post response