Skip to content

Instantly share code, notes, and snippets.

@aroc
Created July 1, 2013 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aroc/5902663 to your computer and use it in GitHub Desktop.
Save aroc/5902663 to your computer and use it in GitHub Desktop.
var options = new Array();
$('select[name=select_name] > option').each(function (i) {
options[i] = $(this).text();
});
var string = "";
for (var i=0; i<options.length; i++) {
string += "\"" + options[i] + "\"" + ",";
if (i + 1 != options.length) {
string += "\n";
}
}
console.log(string);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment