我有一個web窗體,與asp控件,我想看看它是否檢查顯示更多的信息(複選框1被選中 - 「div:yourDivClass顯示)。但在我的網頁它不工作 這裏是我的代碼:webform沒有運行腳本
<%@ Page Title="Form" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Form.aspx.cs" Inherits="WebApplication1.Form" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<!DOCTYPE html>
<html>
<head>
<style>
.yourDivClass{
display:none;}
</style>
<script language="text\javascript">
$("#CheckBox1").change(function() {
if ($(this).attr('checked')) {
$(".yourDivClass").show();
}
});
</script>
</head>
<body>
<asp:Panel ID="Panel1" runat="server">
<table>
<tr>
<td >Do you have...?</td>
<td class="hiddenText">
<asp:CheckBox ID="CheckBox1" runat="server" />
</td>
</tr>
</table>
</asp:panel>
<div class="yourDivClass">Im Your div</div>
<table>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Submit" ForeColor="#FF66FF" OnClick="Button1_Click" />
</td>
<td>
<asp:Label ID="Label1" runat="server" Text="Label" Visible="false"></asp:Label>
</td>
</tr>
</table>
</body>
</html>
</asp:Content>
任何想法,請
任何控制檯錯誤/日誌? – evolutionxbox
@evolutionxbox我沒有看到控制檯中的任何東西,也許我沒有找到正確的地方,請給我進一步的信息? – BKChedlia
谷歌「Chrome開發工具控制檯」,「IE開發工具控制檯」或「Firefox開發工具控制檯」 – evolutionxbox