Javascript fügt Datenelemente zur Dropdown-Liste hinzu.html
="Content-Type" content="text/html; charset=utf-8"/>
Datenelemente dynamisch zur Dropdown-Liste hinzufügen ="text/javascript">
function gel(id) { return document.getElementById(id); }
window.onload = function() {
var cbbYear = gel("mysel ");
for ( var i = 1990; i < 2014; i ) {
//Methode 1
/*var opt = document.createElement("option");
opt.innerHTML = i;
cbbYear.appendChild(opt);*/
//Methode 2
var opt = new Option(i, i);
cbbYear.options. add(opt);
}
< /select>