< DIV>和< select>标签 [英] <div> and <select> tags

查看:103
本文介绍了< DIV>和< select>标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在HTML < SELECT> 标记内使用< DIV> 吗?

Can I have a <DIV> within an HTML <SELECT> tag?

例如:

e.g.:

<select tabindex="2" name="agegrp" id="agegrp" >
    <div> 
        <option value="-1">No preference</option>
    </div>
</select>


推荐答案

规范

From the specification:

<!ELEMENT SELECT - - (OPTGROUP|OPTION)+ -- option selector -->

即有一个名为SELECT的元素,开始标记是必需的,结束标记是必需的。它的孩子可以是OPTGROUP元素和/或OPTION元素,并且必须至少有一个元素。

i.e. There is an element called "SELECT", the start tag is required, the end tag is required. It's children can be OPTGROUP elements and/or OPTION elements and there must be at least one of them.

由于DIV不是OPTGROUP或OPTION,答案是

Since a DIV is not an OPTGROUP or an OPTION, the answer is no.

这篇关于&LT; DIV&GT;和&lt; select&gt;标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆