<input type=text value="alt test"  title="this is a test">
用title属性就可以了

解决方案 »

  1.   

    在input文本框中能否加入像在<img>中加alt一样显示出的浮动提示框。  
    在文本框中默认状态下是空白的。鼠标移上去显示浮动提示框。像在<img>中加alt一样显示出的浮动提示框。不知有没有办法。
      

  2.   

    页面中如果有两个文本框,能不能在不用鼠标的情况下,用Tab键移动光标到第二个文本框。在有光标的文本框中出现提示呢?
    客户要求高啊!大家帮帮忙!
      

  3.   

    参考:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>鼠标提示</title>
    <script language="JavaScript">
    function seashowtip(tips,flag,iwidth){
    var my_tips=document.all.mytips;
    if(flag){
        my_tips.innerHTML=tips;
        my_tips.style.display="";
        my_tips.style.width=iwidth;
        my_tips.style.left=event.clientX+10+document.body.scrollLeft;
        my_tips.style.top=event.clientY+10+document.body.scrollTop;
       }
    else 
      {
       my_tips.style.display="none";
       }
    }
    </script>
    <style>
    body{font-size:12px}
    </style>
    <div id=mytips style="position:absolute;background-color:#ffffff;width:121;height:16;border:1px solid gray;display:none;filter: progid:DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=3); left:0; top:5"></div>
    </head>
    <body>
    <form name="form1" method="post" action="">
      用户名: 
      <input type="text" name="textfield"  tips="*** 输入用户名." onmousemove=seashowtip(this.tips,1,150) onmouseout=seashowtip(this.tips,0,150)>
      <br/>
      密&nbsp; 码: 
      <input type="text" name="textfield2"  tips="*** 输入密码." onmousemove=seashowtip(this.tips,1,150) onmouseout=seashowtip(this.tips,0,150)>
      <br/>
      验证码: 
      <input type="text" name="textfield3"  tips="*** 输入验证码." onmousemove=seashowtip(this.tips,1,150) onmouseout=seashowtip(this.tips,0,150)>
      <input type="submit" name="Submit" value="提交">
    </form>
    </body>
    </html>
      

  4.   

    像TITLE这样的提示像是移动鼠标才激发的,要是这样,
    还是自己作一个提示的DIV,然后自己控件它在焦点的旁边显示,并且有时就显示不时不显示
      

  5.   

    <script> 
    function cls(){ 
    //捕获触发事件的对象,并设置为以下语句的默认对象 
    with(event.srcElement) 
        //如果当前值为默认值,则清空 
    if(value==defaultValue) value="" 

    function res(){ 
    //捕获触发事件的对象,并设置为以下语句的默认对象 
    with(event.srcElement) 
    //如果当前值为空,则重置为默认值 
    if(value=="") value=defaultValue 

    </script> 
    <input value="填写您的昵称" onfocus="cls()" onblur="res()"> 
    <input value="填写您的生日(1900-01-01)"  onfocus="cls()" onblur="res()">
    --------------------------------------
    请问怎样把上面改成文本框默认为空。插入光标是有提示,光标移出时清空文本框。
      

  6.   

    <script> 
    function cls(){ 
    //捕获触发事件的对象,并设置为以下语句的默认对象 
    with(event.srcElement) 
        //如果当前值为默认值,则清空 
    if(value==event.srcElement.defaultValue) value="" 

    function res(){ 
    //捕获触发事件的对象,并设置为以下语句的默认对象 
    with(event.srcElement) 
    //如果当前值为空,则重置为默认值 
    if(value=="") value=event.srcElement.defaultValue 

    </script> 
    <input value="填写您的昵称" defaltValue="填写您的昵称" onfocus="cls()" onblur="res()"> 
    <input value="填写您的生日(1900-01-01)" defaltValue="填写您的生日(1900-01-01)"  onfocus="cls()" onblur="res()"
      

  7.   

    把value去掉
    <script> function cls(){ 
    //捕获触发事件的对象,并设置为以下语句的默认对象 
    with(event.srcElement) 
        //如果当前值为默认值,则清空 
    if(value==event.srcElement.defaultValue) value="" 

    function res(){ 
    //捕获触发事件的对象,并设置为以下语句的默认对象 
    with(event.srcElement) 
    //如果当前值为空,则重置为默认值 
    if(value=="") value=event.srcElement.defaultValue 

    </script> <input defaltValue="填写您的昵称" onfocus="cls()" onblur="res()"> 
    <input defaltValue="填写您的生日(1900-01-01)"  onfocus="cls()" onblur="res()"
      

  8.   

    http://community.csdn.net/Expert/topic/4379/4379684.xml?temp=.8149225
      

  9.   

    不行啊!把value去掉里面的提示就出不来拉。不把value去掉默认就会有提示。光标移出后两文本框的提示都出现了。我是想改成文本框默认为空。插入光标时有提示,只有在插入光标的文本框中才有提示,没有插入光标的不提示,移出时清空所有文本框。
      

  10.   

    哦,加上select就好了。<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
    <head>
    <title>Untitled</title>
    <script> 
    function cls(){ 
    with(event.srcElement) 
    if(value==name) value="" 
    }function res(){ 
    with(event.srcElement) 
    if(value=="") value=name 
    event.srcElement.select();

    </script>
    </head><body>
    Hello World!
    <Form>
    <input type="textbox" value="" onfocus="res();" onblur="cls()" size="40" name="填写您的昵称"> <br/>
    <input type="textbox" value="" onfocus="res()" onblur="cls()" size="40" name="填写您的生日(1900-01-01)"> <br/>
    </Form>
    </body>
    </html>你想要鼠标的,添加onmousedown事件就可以了。测试环境:
    2000Pro
    IE6.0