placeholder IE兼容问题
来源:互联网 发布:热传导分析软件 编辑:程序博客网 时间:2024/06/05 13:23
HTML5里新引入很多有趣的新特征 ,文本框(INPUT)里的placeholder属性。placeholder属性能够让你在文本框里显示提示信息,一旦你在文本框里输入了什么信息,提示信息就会隐藏。你以前可能无数次看到这种效果,但那些大部分是用JavaScript里实现的,而现在,HTML5提供了原生支持,而且效果更好!
<form action="/example/html5/demo_form.asp" method="get"><input type="search" name="user_search" placeholder="Search W3School" /><input type="submit" /></form>
鉴于 placeholder 是个 html5 的属性, IE 下的 placeholder 模拟实现
$(function(){ // placeholder if ($.browser.msie) { $(':text,:password').each(function(){ var label = $('<label>'); label.css({ 'position' : 'absolute', 'margin-left' : '5px', 'margin-top' : '5px', 'color' : 'gray', 'z-index' : 1 }).text($(this).attr('placeholder')).click(function(){ label.hide().next(':input').focus(); }); $(this).before(label).focus(function(){ label.hide(); }).blur(function(){ if ($(this).val() == '') { label.show(); } }); }); }});
0 0
- placeholder IE兼容问题
- placeholder 兼容问题
- placeholder兼容问题
- placeholder 问题考虑密码输入框 ie兼容问题办法
- placeholder 的兼容问题
- 解决placeholder不兼容问题
- placeholder属性的兼容问题
- .IE兼容问题
- IE兼容问题
- IE兼容问题
- ie兼容问题
- IE兼容问题
- ie兼容问题
- IE兼容问题
- placeholder IE失效问题
- placeholder支持ie
- 兼容IE的placeholder
- placeholder兼容ie
- Android中监听Home键的4种方法总结
- JNI编程(AndroidStudio)
- 20. Valid Parentheses(stack)
- mysql 5.7.13 在ubuntu上的安装以及部分简单说明
- 带圆点标示的ViewPager
- placeholder IE兼容问题
- android studio 一些使用问题
- 编写一个删除C语言程序中所有注释语句的程序
- SpringMVC日期绑定
- JavaWeb学习总结(三)——Tomcat服务器学习和使用(二)
- JAVA配置文件的读取
- 四张图包含了020所有的秘密
- 叔恶!今日凌晨潮汕一汽车掉进水沟内,车上三女生身亡!
- CSS3边框 , 背景