Christian S.: Select-Liste mit Javascript füllen

Beitrag lesen

Hi,

var text = document.createTextNode(str);
  opt.appendChild(text);
  opt.setAttribute('value',ref);
  select.appendChild(opt);

Hast du es mal mit new Option probiert?

select.options[select.options.length] = new Option(text, ref);

Gruß!