html select模拟readonly
2015-11-10 19:04
561 查看
select不支持readonly,只能用其他办法去模拟readonly了,效果就是点击select选择元素,然后自动变回默认的。
<select id="test" onfocus="this.defaultIndex=this.selectedIndex;" onchange="this.selectedIndex=this.defaultIndex;"> <option value="1">test1</option> <option value="2">test2</option> <option value="3">test3</option> <option value="4"<span style="font-family: Arial;"> selected="selected"</span><span style="font-family: Arial;">>test4</option></span> <option value="5">test5</option> </select>
相关文章推荐
- 解析html
- html滚动效果
- MVCmoduleExample.html
- fullScreen.html
- html 5 中的 6位 十六进制颜色码 代表的意思
- html 中设置span的width完美解决方法
- @html.ActionLink的几种参数格式
- html脚本语言
- HTML图片热区map area的用法
- 自定义TextView,解决文字排版,对Html格式的文字无效
- data URI scheme(图片直接保存在html页面的方法)
- 标题在上边框中的html(fieldset标签)
- html option禁用选择 select禁用选项示例
- mht转html代码(php)
- XHTML学习<1>
- html多行注释方法
- 使html中的输入框设置为只读状态
- html:关于表单功能的学习
- 正则表达式清除空格和html标签中的 空格
- MVC Html.AntiForgeryToken() 防止CSRF攻击