0

My code is:

<select multiple="multiple" name="store_in_right_side">
<option value="1">supby</option>
<option value="2">supby1</option>
<option value="3">supby2</option>
<option value="4">supby3</option>
</select>

In this how can i get all option id, when i submitting a button.,

KarnaGowtham
  • 95
  • 2
  • 14
  • _all option id_ ? What ? – Rayon Mar 29 '16 at 10:06
  • 1
    Possible duplicate of [Get selected value in dropdown list using JavaScript?](http://stackoverflow.com/questions/1085801/get-selected-value-in-dropdown-list-using-javascript) – Tobias Xy Mar 29 '16 at 10:18

1 Answers1

0
var allval = [];
$('select#search_to ').find('option').each(function() {
allval.push($(this).val());
});

use allval variable you get all values, else

    $('select#search_to ').find('option').each(function() {
    alert($(this).val());
    });
KarnaGowtham
  • 95
  • 2
  • 14