quelqu'un saurait par le plus grand des hasards pourquoi ceci ne marche pas sous IE alors que ca marche sur FF ??

en fait je cherche a remplacer une textbox par un select sur le focus puis a reremplacer le select par une textbox avec la valeur choisie ...

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
16
17
18
19
20
 
<html>
<head>
	<script language="Javascript" type="text/javascript">
	txt_t = null;
	function transformerTxtSelect(txt){
		txt_t = txt;
		select = document.createElement("select");
		select.options.length = 2;
		select.options[0].text = "Sélectionnez";
		select.options[1].text = "Bernard";
		select.setAttribute("onchange", "choix = this.value; this.parentNode.replaceChild(txt_t, this); txt_t.value = choix;");
		txt.parentNode.replaceChild(select, txt);
	}
	</script>
</head>
<body>
	<input type="text" onfocus="transformerTxtSelect(this);">
</body>
</html>

Merci d'avance !