JavaScript -- Select
2014-05-14 17:02
99 查看
-----053-Select.html-----
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>标题</title> </head> <body> <h3>哪条最经典?</h3> <select id="haha" size='7'> <option>宽衣解带终不悔,为伊消得人憔悴</option> <option>君子成人之美,小人夺人所爱</option> <option>穷则独善其身,富则妻妾成群</option> <option>后宫佳丽三千人,铁杵磨成绣花针</option> <option>天若有情天亦老,人不风流枉少年</option> </select> <table> <tr> <td><button onclick="get('lbl1').innerText=get('haha').options[get('haha').selectedIndex].innerText">当前项</button></td> <td id='lbl1'></td> </tr> <tr> <td><button onclick="get('haha').multiple=true">设为多选</button></td> <td><button onclick="get('haha').options.length=0">清空多选框</button></td> </tr> </table> <script type="text/javascript"> function get(el) { return document.getElementById(el); } </script> </body> </html>
相关文章推荐
- javascript中select和div
- javascript特效之radio控制select可用性
- javascript三级联动select
- The Realization of Linked Select by JavaScript and XML
- 实现一个年、月、季度联动SELECT的javascript代码
- 用javascript操作select
- 用javascript实现select的美化的方法
- 用javascript操作select
- [JavaScript] 动态删除下拉列表select的选项
- asp结合javascript,xml,sqlserver制作的无刷新二级select
- 实现select菜单联动的javascript方案
- 使用Javascript完成文件操作、添加新项到HTML控件SELECT中、读取SELECT控件中的选定项
- 用javascript操作select
- javascript客户端操作下拉选择框[select or dropdownlist(.net webcontrol)]
- mshtml:javascript为HTML文件中的Select添加option
- 刚搜集到的 HTML Javascript 控件集 做得非常好 大数据量也没有问题 包含 可编辑表格 Tree可动态拖放 页签 Tab Control 动态 select
- 两个Select互选的Javascript实现
- 【转】用javascript实现select的美化
- javascript 中关于select 的应用和相关操作
- 实现一个年、月、季度联动SELECT的javascript代码