HTML文本框 提示效果
来源:互联网 发布:手机淘宝兼职 编辑:程序博客网 时间:2024/05/20 18:44
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
*{
margin:0px;padding:0px;font-size:12px;
}
input{
width:100px;height:20px;border:1px solid #ccc;
}
</style>
</head>
<body>
<script language="javascript">
function tips(id,str){
var l=document.getElementById(id).offsetLeft+120;
var t=document.getElementById(id).offsetTop;
document.getElementById("tips").innerHTML="提示:"+str;
document.getElementById("tips").style.left=l+"px";
document.getElementById("tips").style.top=t+"px";
document.getElementById("tips").style.display="";
}
function outtips(){
document.getElementById("tips").style.display='none';
}
</script>
<div id="tips" style="position:absolute;border:1px solid #ccc;padding:0px 3px;color:#f00;display:none;height:20px;line-height:20px;background:#fcfcfc"></div>
<br />
姓名:<input type="text" id="username" onfocus="tips('username','姓名长度最多16个字符')" onblur="outtips()" />
<br />
密码:<input type="password" id="password" onfocus="tips('password','密码长度必须在3-18位之间')" onblur="outtips()" />
</body>
</html>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
*{
margin:0px;padding:0px;font-size:12px;
}
input{
width:100px;height:20px;border:1px solid #ccc;
}
</style>
</head>
<body>
<script language="javascript">
function tips(id,str){
var l=document.getElementById(id).offsetLeft+120;
var t=document.getElementById(id).offsetTop;
document.getElementById("tips").innerHTML="提示:"+str;
document.getElementById("tips").style.left=l+"px";
document.getElementById("tips").style.top=t+"px";
document.getElementById("tips").style.display="";
}
function outtips(){
document.getElementById("tips").style.display='none';
}
</script>
<div id="tips" style="position:absolute;border:1px solid #ccc;padding:0px 3px;color:#f00;display:none;height:20px;line-height:20px;background:#fcfcfc"></div>
<br />
姓名:<input type="text" id="username" onfocus="tips('username','姓名长度最多16个字符')" onblur="outtips()" />
<br />
密码:<input type="password" id="password" onfocus="tips('password','密码长度必须在3-18位之间')" onblur="outtips()" />
</body>
</html>
- HTML文本框 提示效果
- 文本框水印提示效果
- 给文本框加上提示效果
- 给文本框加上提示效果
- html文本框提示文字设置
- 文本框下拉提示效果(模拟百度效果提示框)
- 移动鼠标实现链接文本框提示效果
- JavaScript实现带自动提示的文本框效果代码
- html中 实现文本框出现提示的功能
- html中的input文本框完成格式错误提示功能
- <HTML> 给input文本框中添加灰色提示字
- js javascript 表单tips效果,文本框弹出提示框效果(带箭头效果与代码)
- js javascript 表单tips效果,文本框弹出提示框效果(不带箭头效果与代码)
- 实现类似google搜索效果,文本框输入智能提示,(经过改进 支持多个文本框的效果)
- jQuery实现input文本框内灰色提示文本效果 和 input标签获取焦点是文本框内提示信息清空
- 文本框动态提示
- 文本框输入提示
- 自动提示的文本框
- flex AdvancedDataGrid的使用2
- 常用链接
- 绿色版本Tomcat的系统服务配置
- 查找一个目录下的所有文件
- flex AdvancedDataGrid的使用3
- HTML文本框 提示效果
- flex flex AdvancedDataGrid的使用4
- 程序调试中的PDB文件
- XAF之常用的CriteriaOperator
- Windows下Nginx以服务的方式运行
- OpenOffice所有的PropertyValue列表
- 输入一个五位整数,将它反向输出。例如输入12345,输出应为54321。
- 线程池原理分析
- 单链表的相关操作