Skip to content

Instantly share code, notes, and snippets.

@akahn
Created May 26, 2010 19:39
Show Gist options
  • Save akahn/414945 to your computer and use it in GitHub Desktop.
Save akahn/414945 to your computer and use it in GitHub Desktop.
function select_towns(towns) {
var options = $('#search_town_data option');
towns.split(',').each(function(town_id_string) {
options.has('[value='+ town_id_string +']').attr('selected', 'selected');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment