<html>
<head>
<meta charset="UTF-8" />
<title>Multi Select</title>
<script language="JavaScript">
function getSelectedValues() {
var dropDown = document.getElementById('dd1'), countryArray = [], i;
for (i = 0; i < dropDown.options.length ; i += 1) {
if (dropDown.options[i].selected) {
countryArray.push({ Name: dropDown.options[i].text, Value: dropDown.options[i].value });
}
}
console.log(countryArray);
return false;
}
</script>
</head>
<body>
<form onsubmit="return getSelectedValues()">
<label>Multi Select dropdown </label>
<select id="dd1" multiple="true">
<option value="0">India</option>
<option value="1">Pakistan</option>
<option value="2">China</option>
<option value="3">Sri-Lanka</option>
<option value="4">Bangladesh</option>
</select>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>