I'm new to HTML5, and I'm trying to test <select> with the multiple attribute on forms in Google Chrome. I am facing two problems.
First, the list of options changes in the ugly rectangle

While before it was "normal":

My second problem is that it seems that when I want to get select values (by clicking a button and in the code using javascript), only one will be provided ...
Here is my code:
<!DOCTYPE html> <html> <body> How do you travel? <form method="get" id=myForm" onsubmit="done();"> <select name="transport" multiple> <optgroup label="Ecological"> <option value="Feet" selected>By Foot</option> <option value="Bike">By Bike</option> </optgroup> <optgroup label="Non-ecological"> <option value="public transports">With public transports</option> <option value="motorbike">By motorbike</option> <option value="car">By car</option> </optgroup> </select> <button onclick="bdone();">button</button> <script> function bdone(){ var mesOptions=document.getElementsByTagName('select')[0]; alert(mesOptions.value); } </script> </body> </html>
Thanks for reading me!
source share