在標籤里加入以下內容即可
value="你的提示文字" onFocus="if(value==defaultValue){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#999'}"
style="color:#999999"
得到如下效果
在標籤里加入以下內容即可
value="你的提示文字" onFocus="if(value==defaultValue){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#999'}"
style="color:#999999"
得到如下效果