Onchange open URL via select - jQuery
What would be the best way to attach an event so on change of a select option a URL. Store the href in an attr and grab it on change? It is pretty simple, let's see a working example: <select id="dynamic_select"> <option value="" selected>Pick a Website</option> <option value="http://www.google.com">Google</option> <option value="http://www.youtube.com">YouTube</option> <option value="https://www.gurustop.net">GuruStop.NET</option> </select> <script> $(function(){ // bind change event to select $('#dynamic_select').on('change', function () { var url = $(this).val(); // get selected value if