<body>
    <input type="text" value="请输入内容" id="text1" />
</body>

<script>
        var oText1=document.getElementById("text1");
        oText1.onfocus=function(){
            if(this.value=="请输入内容"){
                this.value='';
            }
        }
        oText1.onblur=function(){
            if(this.value==''){
                this.value=="请输入内容";
            }
        }
</script>

 

相关文章:

  • 2021-12-19
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案