Skip to content

Instantly share code, notes, and snippets.

@chihirokaasan
Created March 19, 2018 05:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chihirokaasan/5b835a17707c09465e95f8e88cfbd507 to your computer and use it in GitHub Desktop.
Save chihirokaasan/5b835a17707c09465e95f8e88cfbd507 to your computer and use it in GitHub Desktop.
formのselectによるリンクの遷移 jQuery
<select id="target">
<option value="https://www.yahoo.co.jp/">Yahoo!</option>
<option value="https://www.google.co.jp/">Google</option>
</select>
$(document).ready(function(){
$('#target select').change(function() {
location.href = $('#target').val();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment