How to set "all values" as default in a multiple select?
There are questions on how to make one selection default, like this one. But I have a multiple select and want all the options to be selected initially. I found questions for something similar (like this), but not exactly what I want.
Is this possible without JavaScript?
http://jsfiddle.net/UgHT5/这是你的需要吗?
<select multiple>
<option selected>a</option>
<option selected>b</option>
<option selected>c</option>
</select>
It's much easier than I expected:
<select multiple name="type">
<option selected value="1">type 1</option>
<option selected value="2">type 2</option>
<option selected value="3">type 3</option>
</select>
To find this reference was enough.
链接地址: http://www.djcxy.com/p/88086.html