Created
January 28, 2013 05:56
-
-
Save pafnuty/4653353 to your computer and use it in GitHub Desktop.
Селекты с переходом по ссылке в атрибуте value
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Селекты</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> | |
<script> | |
jQuery(document).ready(function($) { | |
$('.sorting-data').on('change', function () { | |
if($(this).val() != '' || $(this).val() != 'undefined') { | |
window.location=$(this).val(); | |
return false; | |
} | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<select class="sorting-data"> | |
<option value='' selected>Годам</option> | |
<option value="/xfsearch/2013">2013</option> | |
<option value="/xfsearch/2012">2012</option> | |
<option value="/xfsearch/2011">2011</option> | |
</select> | |
<select class="sorting-data"> | |
<option value='' selected>Годам</option> | |
<option value="/xfsearch/2013">2013</option> | |
<option value="/xfsearch/2012">2012</option> | |
<option value="/xfsearch/2011">2011</option> | |
</select> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment