2015-10-21 28 views
0

我試圖驗證碼,並收到以下錯誤:雜散開始標籤label.HTML驗證

Stray start tag label.

在所有3個標籤。

代碼HTML:

<div class="col-md-3 target-col desc-marketing" > 
    <label >Targeted Lists</label> 
    <div class="select-style" id="targeted-list"> 
    <select class="form-control"> 
     <option id="sendToAll" value="1"> 
     <label for="sendToAll">Send To All Patients</label>   </option> 
     <option id="sendToAllLeads" value="2">↩ 
     <label for="sendToAllProspect">Send To All Prospects</label> 
          </option> 

     <option id="sendToAllLeads2" value="3"> 
     <label for="sendToAllLeads">Send To All Leads</label> 
     </option> 

    </select> 
    </div> 
    <span id="or">OR</span> 
</div> 

這個錯誤的起源,我該如何解決呢?

預先感謝您!

回答

1

您不能在<option>標記中添加標籤。請將<label>標籤外:

<label for="sendTo">Targeted Lists</label> 
<div class="select-style" id="targeted-list"> 
    <select class="form-control" id="sendTo"> 
     <option id="sendToAll" value="1">Send To All Patients</option> 
     <option id="sendToAllLeads" value="2">Send To All Prospects</option> 
     <option id="sendToAllLeads2" value="3">Send To All Leads</option> 
    </select> 
</div> 

如果您想自定義標籤的外觀,使用類的選項,這就是全部。

+0

和你覺得我臭取代標籤? – Marius

+0

放置標籤,您需要選擇一個標籤,而不是每個選項3個。我編輯了我的答案。 –