<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>