< option>有什么意义? "标签"属性在< select>内? [英] What's the point of the <option> "label" attribute inside <select>?

查看:141
本文介绍了< option>有什么意义? "标签"属性在< select>内?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了只有IE7 +支持它的事实,为什么你会使用诸如这个例子?即:

 < select> 
< option label =Volvo>沃尔沃(拉丁语中的I roll)< / option>
< option label =Saab> Saab(Swedish Airplane AB)< / option>
< / select>毕竟,'I roll''和'Swedish Airplane AB'的拉丁语是

丢失(即只保留在源代码中)。 在这个例子中, long 在提交表单时,文本将被发送到服务器。



如果存在value属性,则它是多余的。

Besides the fact that only IE7+ supports it, why would you use something such as this example? Namely:

<select>
  <option label="Volvo">Volvo (Latin for "I roll")</option>
  <option label="Saab">Saab (Swedish Aeroplane AB)</option>
</select>

After all, 'Latin for "I roll"' and 'Swedish Aeroplane AB' are lost (i.e., only remain in the source code).

解决方案

In that example, the long text will be sent to the server when the form is submitted.

Given the existence of the value attribute, it is redundant.

这篇关于&lt; option&gt;有什么意义? &QUOT;标签&QUOT;属性在&lt; select&gt;内?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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