Error: End tag for 'optgroup' which is not finished. You have probably failed to
include a required child element. Hence the parent element is "not finished",
not complete. 我想在选择选项中实现这样的目标。
USA
UK
--
Afghanistan我想把少数几个重要国家放在首位,然后是一个不可选择的分裂者,然后是剩余国家的有序名单。
我把这个除法器用空的'optgroup‘。虽然它在所有浏览器中都能很好地工作,但我得到了验证错误。
,实现这个的其他方法可以是什么?
发布于 2010-03-08 13:24:19
与@ZippyV所写的类似,您只需使用<option>并将其禁用:
<option disabled='disabled'>--</option>那是不能选择的。另外,如果是我,我会用m-破折号,而不是两个连字符:
<option disabled='disabled'>—</option>发布于 2010-03-08 13:13:55
你没有发布任何代码,但我敢打赌你肯定有这样的东西:
<select>
<option>USA</option>
<option>UK</option>
<optgroup label="---"></optgroup>
<option>Afghanistan</option>
<option>...</option>
</select>这是无效的,因为optgroup不包含选项元素。你需要使用这样的东西:
<select>
<option>USA</option>
<option>UK</option>
<optgroup label="---">
<option>Afghanistan</option>
<option>...</option>
</optgroup>
</select>发布于 2010-03-08 13:12:59
不要用光学组来做这个。只需将此<option val="-">--</option>放在代码中即可
https://stackoverflow.com/questions/2401437
复制相似问题