我还是个菜鸟,求给的东西简单易懂,有一些介绍是最好的。谢谢!
3条回答 默认 最新
- tsinggao 2015-04-28 16:15关注
<script> function showList() { document.getElementById("div0").style.display = "none"; document.getElementById("div1").style.display = "none"; document.getElementById("div2").style.display = "none"; if(document.getElementById("dishType").value==0) { document.getElementById("div0").style.display = "block"; } if(document.getElementById("dishType").value==1) { document.getElementById("div1").style.display = "block"; } if(document.getElementById("dishType").value==2) { document.getElementById("div2").style.display = "block"; } } </script> <html> <head> <title>根据菜系点餐</title> </head> <body> <br> <br> <div align="center"><h1>请选择菜系:</h1></div> <br> <div align="center"> <select id="dishType" name="dishType" style="width:300px;height:30px" onchange="javascript:showList();"> <option value=0 selected></option> <option value=1>湘菜</option> <option value=2>川菜</option> </select> </div> <hr/> <br> <br> <br> <br> <div id="div0"> <table align="center" width="500px" border="1"> <tr> <td width="20%" height="30px">序号</td> <td width="40%" height="30px">菜名</td> <td width="40%" height="30px">价格</td> </tr> </table> </div> <div id="div1" style="display:none"> <table align="center" width="500px" border="1"> <tr> <td width="20%" height="30px">序号</td> <td width="40%" height="30px">菜名</td> <td width="40%" height="30px">价格</td> </tr> <tr> <td width="20%" height="30px">1</td> <td width="40%" height="30px">小炒肉</td> <td width="40%" height="30px">28元</td> </tr> <tr> <td width="20%" height="30px">2</td> <td width="40%" height="30px">毛家红烧肉</td> <td width="40%" height="30px">48元</td> </tr> <tr> <td width="20%" height="30px">3</td> <td width="40%" height="30px">腊味合蒸</td> <td width="40%" height="30px">38元</td> </tr> </table> </div> <div id="div2" style="display:none"> <table align="center" width="500px" border="1"> <tr> <td width="20%" height="30px">序号</td> <td width="40%" height="30px">菜名</td> <td width="40%" height="30px">价格</td> </tr> <tr> <td width="20%" height="30px">1</td> <td width="40%" height="30px">麻婆豆腐</td> <td width="40%" height="30px">18元</td> </tr> <tr> <td width="20%" height="30px">2</td> <td width="40%" height="30px">水煮肉片</td> <td width="40%" height="30px">38元</td> </tr> <tr> <td width="20%" height="30px">3</td> <td width="40%" height="30px">宫保鸡丁</td> <td width="40%" height="30px">28元</td> </tr> </table> </div> <div id="div3" style="display:none"></div> <div id="div4" style="display:none"></div> </body> </html>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 宇视监控服务器无法登录
- ¥15 PADS Logic 原理图
- ¥15 PADS Logic 图标
- ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
- ¥20 气象站点数据求取中~
- ¥15 如何获取APP内弹出的网址链接
- ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
- ¥50 STM32单片机传感器读取错误
- ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
- ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)