<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript">
window.onload=function(){
var btn=document.getElementById(‘btn‘);
var text=document.getElementById(‘text‘);
var sele=document.getElementById(‘sele‘);
btn.onclick=function(){
text.value=sele.value;
}
}
</script>
<title></title>
</head>
<body>
<input type="text" id="text" />
<select name="" id="sele">
<option value="上海">上海</option>
</select>
<input type="button" id="btn" value="确定" />
</body>
</html>
时间: 2024-10-16 10:23:12