Skip to content

Instantly share code, notes, and snippets.

@chihirokaasan
Created March 19, 2018 05:05
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