How to set "all values" to default with multiple selection?

There are questions about how to make one default choice, like this one . But I have multiple choices and you want all options to be selected initially. I found questions for something similar (like this ), but not exactly what I want.

Is this possible without JavaScript?

+6
source share
2 answers

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

<select multiple> <option selected>a</option> <option selected>b</option> <option selected>c</option> </select> 
+5
source

This is much simpler 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> 

Finding this link was enough.

+2
source

Source: https://habr.com/ru/post/958859/


All Articles