0

I am using Select2 jquery plugin to select mulitple values from dropdown. I have used following code :

 <select id="countries" name="countries[]" multiple="multiple">
  <option *ngFor="let country of countries" value="{{country}}">{{country}}</option>
 </select>

Now I couldnot find which property I should use to get the list of selected values

user9040429
  • 690
  • 1
  • 8
  • 29

2 Answers2

0

This will give selected value :

$("#countries").val();
Dhruv Raval
  • 1,535
  • 1
  • 8
  • 15
-1

This may help.

var value = $('#countries').val();

you can check it or join it.

alert(value.join(' ,'));
Mcfaith
  • 269
  • 4
  • 16