Using multiple-choice select lists
Select lists can be made to allow users to select multiple elements.
Multiple-choice select lists have a special serialization model. In this recipe we're going to look at how that model works and how to use it.
We're going to create a page with a form containing a multiple-choice select list. This form will send a GET
request to another page where we're going to extract the selected items via JavaScript.
How to do it...
Follow these steps:
Create a basic page with a form that has a multiple select list as shown in the following code snippet:
<!DOCTYPE HTML> <html> <head> <title>Dropdown</title> </head> <body> <form method="get" action="result.html"> <select name="multi" multiple> <option value="1">First</option> <option value="2">Second</option> <option value="3">Third</option> <option value="4">Fourth</option...