Checkbox是随机生成span标签。 当前代码:
<asp:CheckBox ID="CheckBox_select" type="checkbox" ClienIDMode="Static" runat="server" onclick="javascript:CheckCheckBox(this);" />
<asp:Label AssociatedControlID="CheckBox_select" ClientIDMode="Static" runat="server" ID="cbs" />
生成:
<span type="checkbox"><input id="CheckBox_select" type="checkbox" name="ctl00$ContentPlaceHolder1$GridView_reminderList$ctl02$CheckBox_select" onclick="javascript:CheckCheckBox(this);"></span>
如何删除Span标签?
请您参考如下方法:
$('#CheckBox_select').unwrap();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span type="checkbox"><input id="CheckBox_select" type="checkbox" name="ctl00$ContentPlaceHolder1$GridView_reminderList$ctl02$CheckBox_select" onclick="javascript:CheckCheckBox(this);"></span>
Description: Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.