Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set "all values" as default in a multiple select?

Tags:

html

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?

like image 594
Pavel V. Avatar asked Nov 26 '13 13:11

Pavel V.


1 Answers

http://jsfiddle.net/UgHT5/ is this your need?

<select multiple>
    <option selected>a</option>
    <option selected>b</option>
    <option selected>c</option>
</select>
like image 131
qiu-deqing Avatar answered Oct 23 '22 06:10

qiu-deqing