【发布时间】:2012-10-09 08:21:59
【问题描述】:
目前,我有这个:
<asp:CheckBoxList ID="chkSections" runat="server" onselectedindexchanged="chkSections_SelectedIndexChanged"></asp:CheckBoxList>
...生成这个:
<table border="0" id="ctl00_cpBody_chkSections">
<tbody><tr>
<td><input type="checkbox" name="ctl00$cpBody$chkSections$0" id="ctl00_cpBody_chkSections_0"><label for="ctl00_cpBody_chkSections_0">All Sections</label></td>
</tr><tr>
<td><input type="checkbox" name="ctl00$cpBody$chkSections$1" id="ctl00_cpBody_chkSections_1"><label for="ctl00_cpBody_chkSections_1">Personal Health Status and Health History</label></td>
</tr><tr>
<td><input type="checkbox" name="ctl00$cpBody$chkSections$2" id="ctl00_cpBody_chkSections_2"><label for="ctl00_cpBody_chkSections_2">Physical Activity and Fitness</label></td>
</tr>
</tbody></table>
问题:我希望生成的所有input 字段都有一个特定的类。不想用jQuery。
【问题讨论】:
-
添加了 ASP.NET 标记(因为您没有使用“经典 ASP”)。还删除了 jQuery 标记,因为您不想使用该框架。添加了 css.
-
@Cyborgx37 FWIW,jquery 是 javascript 语言的框架
-
@BrianWebster - 从技术上讲是的,但它确实看起来独一无二。 :) 更新我的评论。
-
@Cyborgx37 确实,很好的编辑。只是想指出这一点,以防您对框架不太熟悉