您的位置:首页 > Web前端 > HTML

可选择也可输入的下拉列表框,html文件

2018-01-25 17:14 429 查看
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Insert title here</title>
<style type="text/css">
div,span,p,td,font{font-size:9pt;}
</style>
<script type="text/javascript" src="js/jquery-1.7.min.js"></script>
<script type="text/javascript">
function fun(){
var select = $("#aabb").find("option:selected").text();
alert("选择:"+select);
}
</script>

</head>

<body>
<span style="absolute;margin-top:-12px;">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td align="left"><span
style="position:absolute;border:1pt solid #c1c1c1;overflow:hidden;width:188px;height:19px;clip:rect(-1px 190px 190px 170px);">
<select name="aabb" id="aabb"
style="width:190px;height:20px;margin:-2px;"
onChange="javascript:document.getElementById('ccdd').value=document.getElementById('aabb').options[document.getElementById('aabb').selectedIndex].value;">
<option value="" style="color:#c2c2c2;">---请选择---</option>
<option value="闲人书库">闲人书库</option>
<option value="闲人BLOG">闲人BLOG</option>
<option value="闲人设计">闲人设计</option>
<option value="闲人软件">闲人软件</option>
</select>
</span> <span
style="position:absolute;border-top:1pt solid #c1c1c1;border-left:1pt solid #c1c1c1;border-bottom:1pt solid #c1c1c1;width:170px;height:19px;">
<input type="text" name="ccdd" id="ccdd" value="可选择也可输入的下拉框"
style="width:170px;height:15px;border:0pt;">
</span></td>
</tr>
</table>
</span>
<br />
<button onclick="fun()">OK</button>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: