{
document.write('<input type="text" name="text'+i+'" id="text'+i+'">')
}
<script language="javascript">function showtxt(str)
{
document.getElementById("showvalue").value=str
}
</script>
<form>
<input type="text" id="txt" name="txt" onKeyDown="if(this.value!='')showtxt('你输入了'+this.value)" onKeyUp="if(this.value!='')showtxt('你输入了'+this.value)">
<select id="sel" name="sel" onChange="showtxt('你选择了'+this.options[this.selectedIndex].value)">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="radio" id="rad" name="rad" value="yes" onClick="if(this.checked)showtxt('你选择了'+this.value)">yes
<input type="checkbox" id="che" name="che" value="no" onClick="if(this.checked){showtxt('你选择了'+this.value)}else{showtxt('')}">no
<br>
显示<input type="text" id="showvalue" name="showvalue">
</form>