87,910
社区成员
发帖
与我相关
我的任务
分享
<script>
function getValue(name){
var txt_box=document.getElementById('txt');
var field=document.getElementById(name).value;
txt_box.value=field.innerHTML;
}
</script>
<select id="select" name="select" onchange="getValue('select'); return false;">
<option value="123456789">aaa</option>
<option value="abcdefg">bbb</option>
<option value="123abc">ccc</option>
</select>
<input type="text" name="txt" id="txt" />
<script>
function getValue(value){
var txt_box=document.getElementById('txt');
txt_box.value=value;
}
</script>
<select id="select" name="select" onchange="getValue(this.value)">
<option value="123456789">aaa</option>
<option value="abcdefg">bbb</option>
<option value="123abc">ccc</option>
</select>
<input type="text" name="txt" id="txt" />
<script>
function getValue(name){
var txt_box=document.getElementById('txt');
var field=document.getElementById(name).options[0].value;//这里要用选择option
txt_box.value=field;
}
</script>
<select id="select" name="select" onchange="getValue('select'); return false;">
<option value="123456789">aaa</option>
<option value="abcdefg">bbb</option>
<option value="123abc">ccc</option>
</select>
<input type="text" name="txt" id="txt" />