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> |