选择下拉框中不同的值,文本框里也相应的变,清高手门指点

请问怎样把下拉框的值插入到文本框中,谢谢高手们。
选择下拉框中不同的值,文本框里也相应的变,清高手门指点
---------------------------------------------------------------

1<form name="form1">
2<select name="sel" onchange="this.form.txt1.value = this.value; this.form.txt2.value = this.options[this.selectedIndex].text;">
3<option value="1">a</option>
4<option value="2">b</option>
5<option value="3">c</option>
6<option value="4">d</option>
7<input name="txt1" type="text"/>
8<input name="txt2" type="text"/>
9</select></form>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus