input标签获取焦点时文本框内提示信息清空  火狐怎么实现 
http://apps.hi.baidu.com/share/detail/16449411
这里的代码 就是火狐上没代码

解决方案 »

  1.   


    <!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" >
    <head>
        <title>123</title>
        <script type="text/javascript">
            function cls() {
                if (document.getElementById("name").value == "填写您的昵称") {
                    document.getElementById("name").value = "";
                }        }
            function res() {
                if (document.getElementById("name").value == "") {
                    document.getElementById("name").value = "填写您的昵称";
                }
            }
        </script>
    </head>
    <body>
        <input id="name" value="填写您的昵称" onfocus="cls();" onblur="res();" />
    </body>
    </html>
      

  2.   

    $('#text').focus(function(){$(this).val()=""});
      

  3.   

    $('#text').focus(function(){$(this).val()=""});
      

  4.   

    $('#text').focus(function(){$(this).val()=""});
      

  5.   

    楼上两位的都可以,二楼的是jquery的方法。