当前位置: 代码迷 >> Java Web开发 >> 新手,哪位高手有这样的程序啊
  详细解决方案

新手,哪位高手有这样的程序啊

热度:610   发布时间:2016-04-17 16:09:07.0
新手,谁有这样的程序啊?
现在有三个按钮:t1,t2,t3和一个下拉列表框(值t1,t2,t3),需要有一段代码实现这样的到作:当选择按钮t2时,下拉列表框值也相应为t2,选择t3按钮时下拉列表框值为t3,
谁有这样的程序代码或那位帮我写,谢谢啦!

------解决方案--------------------
这么简单的。。。。。不会写
<input type= "button " name= "t1 " onclick= "document.下拉框的名字.value= 't1 ' ">
<input type= "button " name= "t2 " onclick= "document.下拉框的名字.value= 't2 ' ">
<input type= "button " name= "t3 " onclick= "document.下拉框的名字.value= 't3 ' ">
这个样子不知道行不行哦.
------解决方案--------------------
<select name= "aa ">
<option value= "t1 "> t1 </option>
<option value= "t2 "> t2 </option>
<option value= "t3 "> t3 </option>
</select>
<input name= "t1 " type= "button " value= "t1 " onclick= "document.all.aa.value= 't1 ' ">
<input name= "t2 " type= "button " value= "t2 " onclick= "document.all.aa.value= 't2 ' ">
<input name= "t3 " type= "button " value= "t3 " onclick= "document.all.aa.value= 't3 ' ">
------解决方案--------------------
楼上两位正解
  相关解决方案