<html>
<head>
<script src="jquery.min.js"></script>
<script>
$("document").ready(function ()
{
var val = [];
$("#myselect option:selected").each(function () {
val.push(this.text);
});
alert(val.join(',')); //Output: Mr,Ms,Prof
alert(val.join(',')); //Output: Mr,Ms,Prof
});
</script>
</head>
<body>
<select id="myselect" multiple="multiple">
<option value="1" selected="selected">Mr</option>
<option value="2">Mrs</option>
<option value="3" selected="selected">Ms</option>
<option value="4">Dr</option>
<option value="5" selected="selected">Prof</option>
</select>
</body>
</html>
Download this Clickhere
0 comments:
Post a Comment