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?
If you don't want the url to put it on option's value, i'll give u example :
<select class="abc">
<option value="0" href="hello">Hell</option>
<option value="1" href="dello">Dell</option>
<option value="2" href="cello">Cell</option>
</select>
$("select").bind('change',function(){
alert($(':selected',this).attr('href'));
})
**redirect on change option with jquery**
<select id="selectnav1" class="selectnav">
<option value="#">Menu </option>
<option value=" https://www.google.com">
Google
</option>
<option value="http://stackoverflow.com/">
stackoverflow
</option>
</select>
<script type="text/javascript">
$(function () {
$('#selectnav1').change( function() {
location.href = $(this).val();
});
});
</script>