将下拉列表Select的选中值自动添加到文本输入框

发布时间:2017年10月21日 作者:未知 查看次数:1227

将下拉列表Select的选中值自动添加到文本输入框

http://www.codefans.net/jscss/code/303.shtml



<html> 

<title>下拉框的选中值自动添加到文本框</title> 

<head> 

</head> 

<body> 

<form name="form1"> 

<select name="menu1" onChange="document.form1.get.value=this.options[this.selectedIndex].value"> 

<option selected>请选择</option> 

<option value="百度">百度</option> 

<option value="网易">网易</option> 

<input type="text" value="" name="get" id="get"> 

</form> 

</body> 

</html>



版权所有!www.sieye.cn
E.Mail:sieye@sohu.com QQ:66697110