-
-
Save chihirokaasan/5b835a17707c09465e95f8e88cfbd507 to your computer and use it in GitHub Desktop.
formのselectによるリンクの遷移 jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select id="target"> | |
<option value="https://www.yahoo.co.jp/">Yahoo!</option> | |
<option value="https://www.google.co.jp/">Google</option> | |
</select> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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