I have this java script code:
var LANGS = {
"C#": [10, "text/x-csharp"],
"C/C++": [7, "text/x-c++src"],
"Clojure": [2, "text/x-clojure"],
"Java": [8, "text/x-java"],
"Go": [6, "text/x-go"],
"Plain JavaScript": [4, "text/javascript"],
"PHP": [3, "text/x-php"],
"Python": [0, "text/x-python"],
"Ruby": [1, "text/x-ruby"],
"Scala": [5, "text/x-scala"],
"VB.NET": [9, "text/x-vb"],
"Bash": [11, "text/x-bash"],
"Objective-C": [12,"text/x-objectivec"],
"MySQL": [13,"text/x-sql"],
"Perl": [14, "text/x-perl"],
}
I right now I have the following code to show that information as an alert:
$('#langhelp').on('click', function () {
var msg = "These are the languages and their langids: \n[LANGID]: [LANGUAGE]\n";
var langs = [];
for (var i in LANGS) {
msg += LANGS[i][0] + ": " + i + "\n";
}
alert(msg);
});
But what I would like to do is populate an HTML select with this data only I can not figure out how to do so, I have looked at this question but don't see how to append the options to the select element.