Bonjour,
je cherche à afficher un menu déroulant dans une page html à partir d'un fichier javascript.
Dans ma page html j'ai le code suivant :
ceci appelle la fonction javascript suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <script> dateYear(); </script>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 function dateYear(){ var year = new Date().getFullYear(); var yearToDisplay; document.write("<select name =\"birthYear\">"); for (i = 18 ; i <= 100 ; i++) { yearToDisplay = year - i; document.write("<option value=\"" + yearToDisplay.toString() + "\">" + yearToDisplay.toString() + "</option>"); } document.write("</select>"); }
Problème : IE affiche très bien le formulaire.
Mais Firefox ne l'affiche simplement pas ...
Quelqu'un a une idée ?
Merci pour votre aide
Partager