【发布时间】:2011-10-28 12:55:21
【问题描述】:
我正在创建一个自定义控件来为表单制作标签输入块。
以下代码独立运行:
<label id="custom_calendar_label" class="required" for="custom_calendar">Calendar thing: </label>
<input id="custom_calendar" type="date" required="required" aria-labelledby="custom_calendar_label">
但是当我使用自定义服务器控件构建它时,无论出于何种原因,自定义控件周围的 span 标记都会自动生成(而不是来自我的自定义控件中的任何代码),
所以我的代码最终看起来像
<span id ="custom_calendar">
<label id="custom_calendar_label" class="required" for="custom_calendar">Calendar thing: </label>
<input id="custom_calendar" type="date" required="required" aria-labelledby="custom_calendar_label">
</span>
如何动态删除span标签,但保留span标签内的label输入内容?
【问题讨论】:
-
请不要在标题中添加“asp.net c#”之类的内容。它在标签中,这是它所属的地方。