コンボボックスを入力できます

2327 ワード

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<script type="text/javascript" src="js/jquery.js"></script>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Language" content="<#ZC_BLOG_LANGUAGE#>" />
		<title>           </title>
		<script type="text/javascript" src="js/jquery-1.7.min.js"></script>
		<script type="text/javascript">
	$(document).ready(function()
	{
		$("#changeItem").bind("click", function() {
		     var flag =   $("#inputer").is(":visible");   //           
			 $("#inputer").toggle(1,function(){ 
			    $("#selecter").toggle(flag);
			    if ( $("#changeItem").attr("value") == "  "){
			        $("#changeItem").val("  ") ;
			    }
			     else{
			        $("#changeItem").val("  ") ;
			    }
			    }); 
			
			 }); 
	});
</script>
	</head>
	<body>
                
		<form action="">
			<table>
				<tr>
					<td>
					</td>
				</tr>
				<tr>
					<td align="left" width="190">
						<input type="text" name="inputer" id="inputer"
							style="width: 190px; height: 20px; margin: -2px;"/ >
						<select name="selecter" id="selecter"
							style="width: 190px; height: 20px; margin: -2px; display: none;">
							<option value="">
								   .....
							</option>
							<option value="1">
								    
							</option>
							<option value="2">
								    
							</option>
							<option value="3">
								    
							</option>
							<option value="4">
								    
							</option>
						</select>

					</td>
					<td align="left" width="190">
						<input type="button" style="" id="changeItem" value="  " />
					</td>
				</tr>


			</table>
		</form>

	</body>
</html>