creer des option d'un select avec l'api DOM - HTML/CSS - Programmation
Marsh Posté le 20-08-2002 à 11:20:10
j'ai trouver ça ...ça marche mais tres ellegant  
 
 
var anOption = document.createElement("OPTION" ) 
document.form1.select1.options.add(anOption) 
anOption.innerText = "Two" 
anOption.Value = "2" 
Marsh Posté le 20-08-2002 à 10:38:02
Salut
 ;
;  ;
;  ;
;  ;
; 
 
 
Je creer dans une fonction Javascript un objet select
je cherche à lui attribuer des options...
nvx_Liste=window.parent.parent[1].document.createElement('select'
nvx_option=window.parent.parent[1].document.createElement('option'
nvx_option.setAttribute('value','bonjour'
nvx_option.setAttribute('text','bonjour'
nvx_Liste.appendChild(nvx_option);
Mais bien sur j'ai aucune option
Comment feriez vous ça!!