kuco
高级会员

一半会员
UID 66126
精华
0
积分 961
帖子 964
金钱 909 喜悦币
威望 0
人脉 52
阅读权限 50
注册 2005-8-23 来自 上海
状态 离线
|
[推荐阅读] 北京金山-招聘PHP程序员
<input type="text" id="myInput" value="aaaa">
<select id="mySelect" onchange="return getValue('myInput', 'mySelect')">
<option value="0" selected>aaaa
<option value="1">bbbb
<option value="2">cccc
<option value="3">dddd
</select>
<script language="JavaScript">
function getValue(inputId, selectId){
var obj_input = document.getElementById(inputId);
var obj_select = document.getElementById(selectId);
var option_str = obj_select.options[obj_select.selectedIndex].text; //这里是关键
obj_input.value = option_str;
}
</script>
|  阿里妈妈再掀疯狂采购风,急召天下站长,新加入站点3天内一定采购! |
|