showing results for - "location on select dropdown redirect jquery"
Rafael
21 Nov 2018
1<select id="dynamic_select">
2  <option value="" selected>Pick a Website</option>
3  <option value="http://www.google.com">Google</option>
4  <option value="http://www.youtube.com">YouTube</option>
5  <option value="https://www.gurustop.net">GuruStop.NET</option>
6</select>
7
8<script>
9    $(function(){
10      // bind change event to select
11      $('#dynamic_select').on('change', function () {
12          var url = $(this).val(); // get selected value
13          if (url) { // require a URL
14              window.location = url; // redirect
15          }
16          return false;
17      });
18    });
19</script>