我正在創建一個自定義控件來爲表單創建標籤輸入塊。動態刪除跨度標籤,同時保留內容
下面的代碼運行在擁有:
<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 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>
如何動態地刪除跨度標籤,但保留標籤輸入CON span標籤內的帳篷?
它是一個CompositeControl嗎? – Mantorok
請保留你的標題之外的東西,如「asp.net c#」。它在標籤中,這就是它所屬的地方。 –