替代占位符,以便在Internet explorer中工作
alternative for placeholder in order to work at internet explorer
占位符不能在ie浏览器中使用。
1)当我测试1ts时,它可以在chrome, firefox中工作,但不能在internet explorer中工作。
2)当我第二次测试时,它在chrome, firefox和Internet explorer上运行良好。
我在这里面临的问题是,当我添加(ID="txtUserID")这到(2)它不工作在internet explorer。但是我需要(ID="txtUserID")这个,以便在后端使用它。
有解决方案吗?
****************1*******************
<asp:TextBox ID="txtUserID" CssClass="form-control" type="text" placeholder="Username " Width="100%" Height="36px" runat="server" Text="adminuser" MaxLength="16" />
****************2*******************
<asp:TextBox CssClass="form-control" Width="100%" Height="36px" MaxLength="16" Text="adminuser" runat="server" value="Username......" placeholder="Username" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"> </asp:TextBox>
替代占位符:使用jquery的onblur函数,相应改变文本框的值
<!DOCTYPE html>
<html>
<body>
Enter your name: <input id="#yourID" type="text" value="placeholder" onfocus="myFunction(this)" onblur="addPlaceHolder(this)">
<script>
function myFunction(x) {
x.value = "";
}
function addPlaceHolder(thisEle){
if(thisEle.value=='Place Holder' || thisEle.value=='')
thisEle.value='Place Holder';
}
</script>
</body>
</html>
相关文章:
- 视频HTML没有'无法在Internet Explorer 11上工作
- Internet Explorer缺少占位符支持,特别是密码字段
- Internet Explorer中的文本换行错误
- 为什么我在Internet Explorer上看不到html元素
- internet explorer 8兼容模式下的Youtube api错误
- 当浏览器控制台未打开时,为什么要求会导致Internet Explorer 9超时
- Internet Explorer 8. Events
- jQuery表单验证适用于Mozilla和Internet Explorer,但不适用于Chrome或Safari
- element.dataset in Internet Explorer
- Facebook FB.init”;访问被拒绝”;在Internet Explorer 11中
- JavaScript不适用于internet explorer和Firefox,但适用于谷歌
- 在Internet Explorer中,向所选内容添加选项不起作用
- 在Internet Explorer中从二进制文件打开PDF
- elementproblem internet explorer
- 我可以使用哪些方法在Internet Explorer中禁用Alt+*X*
- 如何在Internet Explorer中使用javascript设置cookie
- 只有当alert()在带有AJAX的internet explorer中使用时,Javascript才会更新UI
- sharepoint站点的internet explorer中出现Javascript错误
- Internet Explorer重新加载IFrame
- 如何在不使用Internet Explorer的情况下从未挂起的HTML文件执行程序