标签:== UNC div ntb ack val function his script
<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>
原生js实现placeholder 当获取焦点时清空,失去焦点且为空时恢复
标签:== UNC div ntb ack val function his script
原文地址:https://www.cnblogs.com/150536FBB/p/9783572.html