<script type="text/javascript" src="C://Scripts/jquery-1.4.1.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script type="text/javascript"> $(function () { $(".panel-btn").on('click', function () { var panelID = $(this).attr("data-panelid"); $('#' + panelID).fadeToggle(200); }); }); </script>
<input type="button" id="Button5" class="panel-btn" data-panelid="Panel5" runat="server" value="Button5" /> <input type="button" id="Button6" class="panel-btn" data-panelid="Panel6" runat="server" value="Button6" /> <input type="button" id="Button7" class="panel-btn" data-panelid="Panel7" runat="server" value="Button7" /> <input type="button" id="Button8" class="panel-btn" data-panelid="Panel8" runat="server" value="Button8" /><br /><br /> <asp:Panel ID="Panel5" style="display:none" runat="server">123</asp:Panel> <asp:Panel ID="Panel6" style="display:none" runat="server">456</asp:Panel> <asp:Panel ID="Panel7" style="display:none" runat="server">789</asp:Panel> <asp:Panel ID="Panel8" style="display:none" runat="server">000</asp:Panel>
$(document).ready
click
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)