<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
function selectedmode(){
var selectObj = document.form1.select1 ;
document.form1.textfield.value=selectObj.options(selectObj.selectedIndex).text ;
}
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<select name="select1" OnChange=selectedmode()>
<option value="1">好</option>
<option value="0">不好</option>
</select>
</form>
</body>
</html>
试试。
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
function selectedmode(){
var selectObj = document.form1.select1 ;
document.form1.textfield.value=selectObj.options(selectObj.selectedIndex).text ;
}
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<input type="text" name="textfield">
<select name="select1" OnChange=selectedmode()>
<option value="1">好</option>
<option value="0">不好</option>
</select>
</form>
</body>
</html>
试试。
解决方案 »
- 如何清除缓存
- 关于DHTMLXTREE的动态加载问题
- 三级联动 学院 专业 班级 (这是三个表,用id号相互关联着) asp+js
- 求高手指点:jquery无限级下拉菜单的问题
- 请问如何取得js数组里面的值呢?
- js获取某个按钮控件的方法返回值
- 请教泛型应用问题
- 把昨天crying_boy老师的范例进行了更改,发出来供大家参考,指正!
- (100分预支,沥血跪求)如何让JavaScript代码读取img对象的中图片上各像素的颜色值?
- 求解:L="<a href=""javascript:myGoPage(-1)"" class=""" & myClass & """>" & s & "</a>" 是什么意思??
- 如何在当前网页上播放wav文件??详情请入内
- http://211.100.7.119/,太酷了,谁能不能搞到代码呀?hoho
<option value="1">好</option>
<option value="0">不好</option>
</select>
<select onchange="document.all.text.value=this.options[this.selectedIndex].text">
<option value="1">aaaaaa</option>
<option value="0">bbbbbb</option>
</select>