我想用jQuery切換功能來切換div。jQuery切換不起作用在我的頁面
這裏是我的代碼:
$(document).ready(function() {
$("#removeSongButton").click(function() {
$("#radioButton1").toggle();
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<asp:Button runat="server" ID="removeSongButton" Text="remove song" />
</div>
<div id="radioButton1">
<asp:RadioButtonList runat="server" ID="radioButton">
<asp:ListItem Text="1" Value="1"></asp:ListItem>
<asp:ListItem Text="2" Value="2"></asp:ListItem>
<asp:ListItem Text="3" Value="3"></asp:ListItem>
</asp:RadioButtonList >
</div>
當我點擊 「removeSongButton」 在div TOGע樂了,馬上切換下來。我想可能是頁面重新加載。
[jQuery的翻轉電不工作(http://stackoverflow.com/questions/3708086/jquery-toggle-not-working) –
不告訴ASP來在服務器上運行它 – charlietfl