是否选择元素具有所需的属性? [英] Does the select element have the required attribute?
本文介绍了是否选择元素具有所需的属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请问select元素具有所需的属性?
Does the select element have the required attribute?
推荐答案
是的,你可以使用HTML5需要的属性。但请记住,第一个值应该是空的。
Yes you can use required attribute in HTML5. But remember, first value should be empty.
<select required>
<option value="">Please select</option>
<option value="first">First</option>
</select>
在这里你得到更多的例子:
Here you get the more example:
<一个href=\"http://dev.w3.org/html5/spec-author-view/the-select-element.html#the-select-element\">http://dev.w3.org/html5/spec-author-view/the-select-element.html#the-select-element
这篇关于是否选择元素具有所需的属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文