1
halfer53 Jun 2, 2016
一般 selected == true
|
2
nigelvon Jun 2, 2016
selected="selected"这个标准
https://www.w3.org/TR/html-markup/option.html |
3
skydiver Jun 2, 2016 via iPad
前面是 html5 ,后面是 xhtml ,不同的标准
|
4
SourceMan Jun 2, 2016
标准不一样,建议直接 selected
|
5
aivier Jun 2, 2016 via Android
一直是 selected ,感觉后者有点啰嗦?
|
6
Slienc7 Jun 2, 2016
只有 XHTML 要求 selected="selected"
其他随意,一般习惯 selected 直接用。 |
7
ChiangDi Jun 2, 2016 via Android
一般我喜欢字数少的
|
9
Tonni Jun 2, 2016
> selected = "selected" or "" (empty string) or empty #
From https://www.w3.org/TR/html-markup/option.html#option.attrs.selected |
10
XianZaiZhuCe Jun 2, 2016 via iPhone
1
|
11
Dreawer Jun 2, 2016
|
12
Dreawer Jun 2, 2016
@Dreawer http://www.dreawer.com/resource/image/A058C77EFA6B8E5AE05331398D9736C7.png
详见 MDN ,需要的是一个布尔值。 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option 不能上传图片什么鬼。。貌似也不能修改自己的回答啊。。。。 |
13
Slienc7 Jun 2, 2016
@Dreawer
写的是 "this Boolean attribute" ,不是说需要一个“布尔值” 参考这个: https://stackoverflow.com/questions/7089584/html-why-boolean-attributes-do-not-have-boolean-value |