解决ie8不支持placeholder方法
2018-01-29 11:36
141 查看
setTimeout(plho,1000);
function plho(){
//判断浏览器是否支持placeholder属性
supportPlaceholder='placeholder'in document.createElement('input');
if(!supportPlaceholder){
var text = document.getElementById("searchInput").placeholder
document.getElementById("searchInput").value = text
document.getElementById("searchInput").style.color = "#999"
document.getElementById("searchInput").attachEvent("onfocus",add);
}
}
function add(){
document.getElementById("searchInput").value =""
document.getElementById("searchInput").style.color="#000"
}
function plho(){
//判断浏览器是否支持placeholder属性
supportPlaceholder='placeholder'in document.createElement('input');
if(!supportPlaceholder){
var text = document.getElementById("searchInput").placeholder
document.getElementById("searchInput").value = text
document.getElementById("searchInput").style.color = "#999"
document.getElementById("searchInput").attachEvent("onfocus",add);
}
}
function add(){
document.getElementById("searchInput").value =""
document.getElementById("searchInput").style.color="#000"
}
相关文章推荐
- 解决ie8不支持placeholder方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 解决eWebEditor支持IE6、IE7、IE8的三个方法
- 解决IE8不支持数组的indexOf方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法 转载
- widows server 2003 装IE8 遇到 此系统不支持 IE8 解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- 解决IE8不支持数组的indexOf方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法 .
- 转载------让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法
- eWebEditor不支持IE8IE7火狐遨游的解决方法
- 解决IE8以下不支持getElementsByClassName的方法
- IE8不支持响应式设计解决方法
- 让IE6 IE7 IE8 IE9 IE10 IE11支持Bootstrap的解决方法