可输入的下拉框

发布于:2014年01月18日已被阅读
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>   
<HEAD>   
<script type="text/javascript">
	
	function display(){	
		var select = document.getElementById("select");
		
		select.size = select.options.length;
		
		
		
 				
 	}
 			
	function nodisplay(){
	
		var select = document.getElementById("select");
		select.size = 1;	
	}
	
	function changeValue(){
		var select = document.getElementById("select");
		var selectValue = select.options[select.selectedIndex].innerText;
		document.getElementById("box").value = selectValue;
	}
	
</script>
<META http-equiv='Content-Type' content='text/html; charset=gb2312'>   
<TITLE>可输入的下拉框</TITLE>   
</HEAD>   
<BODY >   
  
	<div style="position:relative;">   
	<span style="left:200px;width:180px;overflow:hidden;">   
		<select id = "select" style="width:118px;left:200px" onchange="changeValue()">   
			<option value = "1">北京</option>  
			<option value = "2">上海</option>  
			<option value = "3">西安</option>  
			<option value = "4">天津</option>  
			<option value = "5">大连</option>  
			<option value = "6">成都</option>  
			<option value = "7">深圳</option>  
		</select>
	</span>
	<input id="box" style="width:100px;position:absolute;left:0px;" onkeydown="display();" onkeyup="display();">   
	</div>   
</BODY>
</HTML>


上一篇文章: 列类型

下一篇文章: sublime text2常用插件
热门博文
默认方法2(10114)
听过PHP吗(3498)
javascript是最棒的(1078)
Curl版本POST提交(192)
MySQL小技巧:让你忘记MySQL密码(180)
最新发布
css默认样式(136)
linux samba配置(144)
mysql经典语句(142)
js 中日期 转换成时间戳 例如2013(155)
MySQL字段拼接查询(152)
友情连接
80年代
百度
京ICP备14027197号-1 网站版权归80年代博客所有
正在加载中……