javascript.点击下拉选项,可以选择到input里面。该怎么修改?在线等答案 10
<body><inputid="hello"type="text"name="hell"value=""/><selectid="sel"><option>wqjj</o...
<body>
<input id="hello" type="text" name="hell" value=""/>
<select id="sel">
<option>wqjj</option>
<option>kdee</option>
</select>
</body>
<script type="text/javascript">
function add()
{
var hello = document.getElementById("hello").value;
var sel = document.getElementById("sel");
var index = sel.selectedIndex;
var text = sel.options[index].text;
hello = text;
document.write(text);
document.write(hello);
}
</script> 展开
<input id="hello" type="text" name="hell" value=""/>
<select id="sel">
<option>wqjj</option>
<option>kdee</option>
</select>
</body>
<script type="text/javascript">
function add()
{
var hello = document.getElementById("hello").value;
var sel = document.getElementById("sel");
var index = sel.selectedIndex;
var text = sel.options[index].text;
hello = text;
document.write(text);
document.write(hello);
}
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询