javascript: Weiterer Eintrag in Select-Feld hinzufügen

Um eine Dropdown-Box (Select-Feld) mit einem weiteren Eintrag zu fuellen kann man folgenden Code benutze

 

  1. function addSelectOption(selectionElement, text){
  2. var option = document.createElement("OPTION");
  3. var Text = document.createTextNode(text);
  4. option.appendChild(Text);
  5. selectionElement.appendChild(option);
  6. }
 
 
© onvice 2002 - 2010