Skip to content

Instantly share code, notes, and snippets.

@kylewest
Created December 23, 2014 22:12
Show Gist options
  • Save kylewest/6a558eed30216c2fa663 to your computer and use it in GitHub Desktop.
Save kylewest/6a558eed30216c2fa663 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
$(document).ready(function(){
$('#brandlist ul').hide().parent().append('<select>'); $('#brandlist ul li').each(function(){ var link = $(this).find('a');
$('#brandlist select').append('<option value="'+link.attr('href')+'">'+link.html()+'</option>');
});
$('#brandlist select').on("change", function(){
window.location.href = $(this).val();
});
$('#brandlist').before("//popular brands HTML. make sure to use single quotes (')");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment