click event select option jquery

Solutions on MaxInterview for click event select option jquery by the best coders in the world

showing results for - "click event select option jquery"
Sara
25 Feb 2019
1$('#mySelect').on('change', function() {
2  var value = $(this).val();
3  alert(value);
4});
5<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
6<select id="mySelect">
7  <option value='1'>1</option>
8  <option value='2'>2</option>
9  <option value='3'>3</option>
10  <option value='4'>4</option>
11  <option value='5'>5</option>
12  <option value='6'>6</option>
13  <option value='7'>7</option>
14  <option value='8'>8</option>
15</select>