I have one jquery dropdownlist box with hardcoded values as below.
<h2 class="form-box form-box-default">Jquery Dropdown List with Max 2 select</h2>
<select class="limitedNumbChosen" multiple="true">
<option value="1">Monday</option>
<option value="2">Tuesday</option>
<option value="3">Wednesday</option>
<option value="4">Thursday</option>
<option value="5">Friday</option>
<option value="6">Saturday</option>
<option value="7">Sunday</option>
</select>
<input type="button" value="Get Values" class="submit1" id="submit1" />
<table id="table1">
</table>
I can select multiple options here. I have one button below and i also have one table. On clicking on that button i want to add selected values to table rows. I have below script to get selected values
$("#submit1").click(function () {
{
var selected = $('.limitedNumbChosen :selected').text();
selected.each(function () {
$('table1').append('<tr><td>'+$(this).val() +'</td></tr>');
});
}
});
Here I am able to get selected values to selected. I tried to append each value to table as above but nothing gets binded. Can someone tell me how can i bind the selected values? Thank you