网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 仿163注册提示
范文
    <html>
    <head>
    <title>仿163注册提示显示-网站制作学习网</title>
    <script language="javascript">
    var forasp = new Object;
    forasp.f = function(obj,h)//obj是检测的text文本框,h是自定义要显示提示层距顶部的高度差,可以自行调节。
    {var t = document.getElementById("forasp_cn");
    t.style.top = 12 + h +"px";
    t.innerHTML=obj.title;//将显示的title放到层里面
    t.style.display="";
    }
    forasp.cl = function(obj)
    {
    var t = document.getElementById("forasp_cn");
    if (obj.value.replace(/[^\x00-\xff]/g,"**").length > obj.l);//将中文替换为两个字符
    {alert(obj.title+"长度过长!");obj.value="";obj.focus();}
    t.style.display="none";
    }
    </script>
    </head>
    <body>
    <p><input type="text" size = "25" onfocus="forasp.f(this,0);" onblur="forasp.cl(this)" l="10"><br><!--l表示内容字符的长度,title是显示的内容-->
    <input type="text" size = "25" onfocus="forasp.f(this,22);"  onblur="forasp.cl(this)" l="10"><br>
    <input type="text" size = "25" onfocus="forasp.f(this,45);"  onblur="forasp.cl(this)" l="10"><br>
    <input type="text" size = "25" onfocus="forasp.f(this,68);"  onblur="forasp.cl(this)" l="10"><br>
    <input type="text" size = "25" onfocus="forasp.f(this,91);"  onblur="forasp.cl(this)" l="10"><br></p><br>
    <div id="forasp_cn" >这里是隐藏的一个层,主要用来显示提示内容</div>
    </body>
    </html>
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/12/16 4:16:36